两个inline-block的块没有设置外边距但却有着中间的缝隙。。。。。。。
对于两个inline-block 同一行的时候,会出现间隙。
对于这个间隙可以通过去掉将HTML中两个块对应的代码中间的空格来去除两个块中的间隙
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>inline-block</title>
</head>
<style type="text/css">
.box1{
width: 200px;
height: 200px;
background: green;
display: inline-block;
}
.box2{
width: 200px;
height: 200px;
background: red;
display: inline-block;
}
</style>
<body>
<div class="box">
<div class="box1"></div><div class="box2"></div> <!--这里看这一行,两个div中间没有空格-->
</div>
</body>
</html>