我在想,我可以做這樣的:垂直對齊inline-block的元素
<div style='height:100px;vertical-align:middle;border:1px solid red;'>
<div style='display:inline-block;'>hi there</div>
<div style='display:inline-block;'>hi there</div>
</div>
和裏面的div會得到中間垂直對齊,但由於某種原因,這並不工作, 的只有這樣,我實現了這個ATM是這樣做的(使用的line-height =身高):
<div style='height:100px;border:1px solid red;line-height:100px;'>
<div style='display:inline-block;'>hi there</div>
<div style='display:inline-block;'>hi there</div>
</div>
什麼是這樣做的正確方法?
的可能重複[CSS - 垂直對齊DIV內容](http://stackoverflow.com/questions/1881245/css-vertical-align-div-content) – j08691