兼容各种浏览器的居中样式
兼容各种浏览器的居中样式
<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>