转成内联块级元素实现并排为什么两个元素之间有距离,都设置margin为0了啊,用浮动float:left实现这两个div之间就没有
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>浮动模型</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
div{
border:2px red solid;
width:200px;
height:400px;
display:inline-block;
/*float:left;*/
}
</style>
</head>
<body>
<div id="div1">栏目1</div>
<div id="div2">栏目2</div>
</body>
</html>