当前位置: 首页 > 图文教程 > 网页制作 > CSS样式表 > 不用js多浏览器兼容纯DIV/CSS对联漂浮广告代码

CSS样式表
event.currentTarget和document.activeElement用法
指定网页doctype解决CSS Hacking
揭开迷惑 理解CSS的浮动Float
css网页布局中注意的几个问题
H1的位置对SEO的影响
网页制作与CSS的UTF-8和GB2312编码问题
CSS制作政府公文的代码
不要使用的HTML标签(WEB标准网页布局)
CSS网页设计时关于字体大小的设计
css教程:网页字体及字体大小的设计
描述性列表UL和DL的表现形式
CSS Alpha透明相关知识学习
关于W3C CSS标准的一些经验
CSS3属性选择符介绍
CSS网页布局的好处与坏处
div css制作网页实战笔记心得
Opera下cloneNode的bug
CSS:清除浮动的最优方法
由浅入深实践学习 Web 标准
另一个角度谈谈DIV CSS

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-12   浏览: 309 ::
收藏到网摘: n/a

两侧漂浮。经测试,兼容IE6,IE7,Firefox浏览器 纯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="http://www.ruanchen.com" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>
<div class="r2"><a href="http://www.ruanchen.com" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>
<div class="l1"><a href="http://www.ruanchen.com" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>
<div class="l2"><a href="http://www.ruanchen.com" target='_about'><img src="/js/pic/piao-l-1.gif" width="80" height="80" border="0" /></a></div>