纯CSS兼容IE6的模拟的fixed效果_不抖动

CSS固定底部与兼容性
本文介绍了使用纯CSS实现固定底部效果的方法,并确保了在不同浏览器间的兼容性,特别是IE6。通过特定的布局技巧,文章展示了如何创建一个始终位于页面底部的浮动栏。

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>纯CSS兼容IE6的模拟的fixed效果</title>
<style>
* { margin:0; padding:0; }
html, body { height:100%; overflow:hidden; }
.page { height:100%; overflow:auto; }
.floatbar { position:absolute; bottom:0; left:2%; border:1px solid #ccc; background:#06c; color:#fff; height:30px; width:95%; }
</style>
</head>
<body>
<!--此处page的div模拟body的表现-->
<div class="page">
	<div style="height:1500px">内容区</div>
</div>
<!--/此处page的div模拟body的表现-->
<div class="floatbar">模拟的固定fixed效果 </div>
</body>
</html>

 绝对底部效果:

 

<!DOCTYPE>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>绝对底部</title>
<style type="text/css">
* { margin:0; padding:0; }
html, body { height:100%; }
.wrapper { min-height:100%; _height:100%; }
.body { padding-bottom:100px; }
.footer { margin-top:-100px; height:100px; background:red; }
</style>
</head>
<body>
<div class="wrapper">
	<div class="body">
		<script type="text/javascript">
		for(var i=0; i<10; i++){ //可增加或减少i值
			document.write(i+"<br />");
		}
		</script>
	</div>
</div>
<div class="footer"> footer </div>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值