标题:
兼容各种浏览器的居中样式
[打印本页]
作者:
wolftears
时间:
2010-11-9 14:57
标题:
兼容各种浏览器的居中样式
兼容各种浏览器的居中样式
<html><head> <title>http://www.divcss5.com</title>
<style type="text/css">
.box{width:200px; height:200px; border:1px solid #000; position:fixed; left:50%; top:50%;margin-left:-100px;margin-top:-100px;_position:absolute;_top:expression(eval(document.documentElement.clientHeight/2+document.documentElement.scrollTop)); _left:expression(eval(document.documentElement.clientWidth/2+document.documentElement.scrollLeft); }
</style></head><body>
<div class="box">http://www.divcss5.com</div> </body></html>
作者:
wolftears
时间:
2010-11-22 09:02
标题:
兼容各种浏览器的居中样式
body{margin:0px;
padding:0px;
width:1024px;
margin-left:auto;
margin-right:auto;}
同时兼容safari
欢迎光临 CSS论坛 (http://www.divcss5.com/bbs/)
Powered by Discuz! 6.1.0