随笔-21  评论-6  文章-0  trackbacks-0
CSS:
1#adflcenter { left: 0px; right: 0px; top: 25%; *top: 50%; position: fixed; }
2* html #adflcenter {  position: absolute; padding: 0px 10px; top: expression(offsetParent.scrollTop + screen.availHeight/2.22); }
3#adflcenter div { position: relative; top: -50%; margin: 0px auto; }
 
HTML:
1<div id="adflcenter"><div style="height: 300px; width: 760px;"></div></div>
 
注:需要设置外部div的高度,内部div的高度和宽度。
 
 
如页面无声明页面类型,则使用以下CSS代码(在大于1024x768分辨率的情况下会偏离居中)
1#adflcenter { height: 0px; left: 13%; top: 25%; position: fixed; }
2* html #adflcenter {  position: absolute; padding: 0px 10px; top: expression(offsetParent.scrollTop + screen.availHeight/2.22); }
3#adflcenter div { position: relative; top: -50%; left: -25% margin: 0px auto; }

posted on 2008-06-23 10:16 xxxx 阅读(4069) 评论(0)  编辑 收藏 引用 网摘 所属分类: HTML / DIV+CSS

只有注册用户登录后才能发表评论。
网站导航: