我在想我可以这样做:
<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 = to 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>
这样做的正确方法是什么?