您的位置:首页 > Web前端 > CSS

关于display: inline-block 默认空白间距的问题

2016-08-06 17:04 453 查看

问题描述

废话不多说,直接上代码

html

<div class="box1">
</div>
<div class="box2">
</div>
<div class="box3">
</div>


css

.box1,
.box2,
.box3 {
width: 20px;
height: 20px;
background-color: #E11;
display: inline-block;
}


效果图



解决方法

各个标签之间,不能有空格

html

<div class="box1">
</div><div class="box2"> // 标签前后没有空格
</div><div class="box3">
</div>


效果图

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  html css display bug