浮动模型中,div1{margin-left:10px}和div2{margin-right :10px},为什么两个div之间间距是20px而不是10px?
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>浮动模型</title> <style type="text/css"> div{ border:2px red solid; width:160px; height:400px; float:left; } #div1{margin-right:10px;} #div2{margin-left:10px;} </style> </head> <body> <div id="div1">栏目1</div> <div id="div2">栏目2</div> </body> </html>