我不明白为什么空div用内容移动div。
div {
width: 100px;
height: 100px;
background-color: red;
border: 2px solid #000;
display: inline-block;
}

<div>a</div>
<div></div>
&#13;
答案 0 :(得分:2)
您需要向他们添加vertical-align
:
div {
width: 100px;
height: 100px;
background-color: red;
border: 2px solid #000;
display: inline-block;
vertical-align:top; /* <-- SEE THIS? */
}
&#13;
<div>a</div>
<div></div>
&#13;
答案 1 :(得分:1)
更改样式
div {
width: 100px;
height: 100px;
background-color: red;
border: 2px solid #000;
float:left;
margin:0 2px;
}
https://jsfiddle.net/anwnacc2/
请检查jsfiddle