本文中所实现的特效就是像有些下载站那样,当你进入到具体的下载页时,它会在页面的顶端用一个鲜亮的颜色提示你选择下载方式或地址,我们暂时把下载站的这种方式称为页眉吧,本例完全反过来了,是永远在页面的最下边,帮也称得上是页脚,用CSS来实现的!贴点儿CSS代码出来:
<style type="text/css">
<!--
#footer {
position:fixed;
left:0px;
bottom:0px;
height:30px;
width:100%;
background:#999;
}
/* IE 6 */
* html #footer {
position:absolute;
top:expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px');
}
-->
</style>
本文介绍了一种使用CSS实现的固定页脚效果,当页面滚动时,该页脚始终保持在屏幕底部。通过设置position:fixed及bottom:0px属性,并针对IE6浏览器提供了兼容方案。
368

被折叠的 条评论
为什么被折叠?



