本文章提供的对联广告是完全使用css实现的,并且兼容所有浏览器,包括各种ie,ff,gg浏览器,代码简洁好用。
代码如下:
<!-- css 代码-->
.couplet_ad
/* 底部固定*/
{position:fixed;bottom:auto; top:0; width: 120px; height: 230px; z-index:99999; margin-top:158px;}
html .couplet_ad
/* IE6 底部固定*/
{_position:absolute;
_bottom:auto;
_top:expression(eval(document.documentElement.scrollTop));}
.couplet_ad a{ display:block; cursor:pointer;}
#ad_left{ left: 0px;}
#ad_right{ right: 0px;}
<!-- html代码 -->
<!-- 对联广告左边 -->
<div>
<a>@@##@@</a>
<a>关闭</a>
</div>
<!-- 对联广告右边 -->
<div>
<a>@@##@@</a>
<a>关闭</a>
</div>
<!-- js关闭按钮代码 -->
<script>
function ad_left(){
document.getElementById('ad_left').style.display="none";
}
function ad_right(){
document.getElementById('ad_right').style.display="none";
}
</script>
相关推荐:
div+css下js对联广告不随屏幕滚动的解决方法_html/css_WEB-ITnose
前端入门到VUE实战笔记:立即使用
在学习笔记中,你将探索 前端 的入门与实战技巧!











