您现在的位置是:网站首页> 编程资料编程资料
不用js多浏览器兼容纯DIV/CSS对联漂浮广告代码_经验交流_
2023-05-25
326人已围观
简介 不用js多浏览器兼容纯DIV/CSS对联漂浮广告代码_经验交流_
纯DIV/CSS对联漂浮广告代码(无JS)
源码网两侧漂浮。经测试,兼容IE6,IE7,Firefox浏览器。
CSS代码为:
.r1{width:80px;height:80px;background:red;float:right;
position:fixed !important; top/**/:200px;
position:absolute; z-index:300; top:expression(offsetParent.scrollTop+200);right:20px;}
.r2{width:80px;height:80px;background:red;float:right;
position:fixed !important; top/**/:300px;
position:absolute; z-index:400; top:expression(offsetParent.scrollTop+300);right:20px;}
.l1{width:80px;height:80px;background:red;float:right;
position:fixed !important; top/**/:200px;
position:absolute; z-index:300; top:expression(offsetParent.scrollTop+200);left:20px;}
.l2{width:80px;height:80px;background:red;float:right;
position:fixed !important; top/**/:300px;
position:absolute; z-index:400; top:expression(offsetParent.scrollTop+300);left:20px;}
页面代码为:
源码网两侧漂浮。经测试,兼容IE6,IE7,Firefox浏览器。
CSS代码为:
复制代码 代码如下:
.r1{width:80px;height:80px;background:red;float:right;
position:fixed !important; top/**/:200px;
position:absolute; z-index:300; top:expression(offsetParent.scrollTop+200);right:20px;}
.r2{width:80px;height:80px;background:red;float:right;
position:fixed !important; top/**/:300px;
position:absolute; z-index:400; top:expression(offsetParent.scrollTop+300);right:20px;}
.l1{width:80px;height:80px;background:red;float:right;
position:fixed !important; top/**/:200px;
position:absolute; z-index:300; top:expression(offsetParent.scrollTop+200);left:20px;}
.l2{width:80px;height:80px;background:red;float:right;
position:fixed !important; top/**/:300px;
position:absolute; z-index:400; top:expression(offsetParent.scrollTop+300);left:20px;}
页面代码为:
复制代码 代码如下:
您可能感兴趣的文章:
相关内容
- css强制换行 css强制不换行的css方法_经验交流_
- table高级应用把表格进行到底(必看)_经验交流_
- Web2.0下XHTML+CSS 设计需要注意的地方小结_经验交流_
- 使用CSS框架布局的缺点和优点小结_经验交流_
- css布局网页水平居中常用方法_经验交流_
- 写CSS_关于Border你可能需要注意的地方第1/2页_经验交流_
- css利用A标签的背景可能作出很有意思的效果第1/2页_经验交流_
- DL.DT.DD实现左右的布局简单例子第1/2页_经验交流_
- 大家看了就明白了css样式中类class与标识id选择符的区别小结_经验交流_
- DIV+CSS布局中不推荐使用的标签集合Dont Use These Tags_经验交流_
