1.同一行的行内块状元素inline-block默认的都是顶端对齐
<style>
<span style="white-space:pre"> </span>.div1,.div2,.div3{display:inline-block;width:100px;height:}
.div1{height:100px;background:#ccc;}
.div2{height:150px;background:#e44;}
.div3{height:200px;background:#237FAD;}
</style>
<body>
<div class="div1">1</div>
<div class="div2">2</div>
<div class="div3">3</div>
</body>
但是这样有一个缺点,如果其中一个设置了margin,那么其他的都会随着一起动,例如给div2添加一个margin-top,其他的两个也都下来了
<style>
.div1,.div2,.div3{display:inline-block;width:1