在IE与FF中如何居中的css写法


IE方法:<body style="text-align:center;">
<body> 标记内的内容居中。
非IE方法:<div style="margin-left:auto;margin-right:auto;"></div>
<div> 标记的左右边距自动适应,以达到居中效果。
标准推荐的CSS使用方法是后者,IE的那套是非标准的。
不过在IE6中使用标准的DTD声明(xhtml版本),也能使用margin:0 auto;方法达到居中效果。

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3