1
div sub
如何將div center
設置爲中間? 文字可以不同,所以在這種情況下邊距或線條高度不是一個好的解決方案。垂直對齊問題:中間;
CSS:
.center {
background-color: #336699;
width: 200px;
height: 200px;
}
.sub {
display: inline-block;
vertical-align: middle;
}
HTML:
<div class="center">
<span class="sub">
Some text text...
</span>
</div>