-
table-cell
显示行为与<td>
一样。🌰 垂直居中 https://codepen.io/twhy/pen/rwejpZ
<div class="cell">
<div class="box"></div>
</div>
.box {
width: 100px;
height: 100px;
margin: auto;
background: slateblue;
}
.cell {
width: 200px;
height: 200px;
display: table-cell;
vertical-align: middle;
background: deepskyblue;
}