不用js多浏览器兼容纯DIV/CSS对联漂浮广告代码

所属分类: 网络编程 / CSS/HTML 阅读数: 521
收藏 0 赞 0 分享
纯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;} 


页面代码为:
复制代码 代码如下:

<div class="r1"><a href="https://www.jb51.net" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>   
<div class="r2"><a href="https://www.jb51.net" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>   
<div class="l1"><a href="https://www.jb51.net" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>   
<div class="l2"><a href="https://www.jb51.net" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>   
更多精彩内容其他人还在看

推荐深入理解css中的position定位和z-index属性

推荐深入理解css中的position定位和z-index属性
收藏 0 赞 0 分享

不错的10个你未必知道的CSS技巧

不错的10个你未必知道的CSS技巧
收藏 0 赞 0 分享

一点小小的创意css鼠标放上去则显示电话号码

一点小小的创意css鼠标放上去则显示电话号码
收藏 0 赞 0 分享

固定表格的高度超过指定高度就隐藏的方法

固定表格的高度超过指定高度就隐藏的方法
收藏 0 赞 0 分享

推荐个Css的filter常用滤波器属性及语句大全

推荐个Css的filter常用滤波器属性及语句大全
收藏 0 赞 0 分享

淘宝段正淳的css笔记大全第1/4页

淘宝段正淳的css笔记大全
收藏 0 赞 0 分享

CSS实现的一个图片放大展示的一种思路

CSS实现的一个图片放大展示的一种思路
收藏 0 赞 0 分享

用css滤镜实现的文字描边效果的代码

用css滤镜实现的文字描边效果的代码
收藏 0 赞 0 分享

用css实现的带阴影的表格效果的代码

用css实现的带阴影的表格效果的代码
收藏 0 赞 0 分享

又一实用的常用CSS缩写语法收集

又一实用的常用CSS缩写语法收集
收藏 0 赞 0 分享
查看更多