<code><</code><code>br</code><code>></code>
一:文字(行内元素)在塊盒子(塊元素)中水準居中:text-aligh:center;
二:文字(行内元素)在塊盒子(塊元素)中垂直居中:設定行高等于盒子高
例如:
height:30px-------->line-height:30px;
三:塊盒子在其父塊盒子中水準居中:margin:0 auto;
四:塊盒子在其父塊盒子中垂直居中:沒有特别的直接屬性可以做到。
五:圖檔和文字在垂直方向對齊:在圖檔上使用------>vertical-align:middle;
本文轉自 沉迷學習中 51CTO部落格,原文連結:http://blog.51cto.com/12907581/1925775,如需轉載請自行聯系原作者