原文链接:http://www.ruanyifeng.com/blog/2010/03/css_cookbook.html
文字的水平居中
1 text-align:center
容器的水平居中
div #container{ width:760px; margin:0 auto; }
文字的垂直居中
<div id="container">123456</div>
div #container{ height:35px; line-height:35px; }
如果有n行文字,那么将行高设为容器高度的n分之一即可。
浙公网安备 33010602011771号