<!DOCTYPE html>
<head>
<style type="text/css">
*{ padding:0px; margin:0px;}
.box{ width:1000px; background:#ccc; margin:0 auto; overflow:hidden;}
.main{ width:770px; height:2000px; background:#000; float:left;}
.sub{ width:220px; background:#FC6; float:right;}
.sub01{ width:220px; height:100px; background:#0CC; margin-bottom:10px;}
.fixed{ width:220px; height:1000px; background:#F66; font:normal 13px/30px \5FAE\8F6F\96C5\9ED1; text-align:center; top:10px; border-bottom: 3px solid #fff}
.fix {
position: fixed;
bottom: 0;
_position: absolute;
_top: documentElement.scrollTop - this.parentNode.clientHeight+documentElement.clientHeight;
}
.fix-btm {
position: relative;
zoom: 1;
}
</style>
</head>
<body>
<p class="box">
<!--代码开始-->
<p class="main"></p>
<p class="sub">
<p class="sub01"></p>
<p class="sub01"></p>
<p class="fixed">我是固定的哟</p>
</p>
<!--代码结束-->
</p>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
<script type="text/javascript">
</script>
</body>
</html>
本人前端菜鸟,刚刚接触前端开发,想实现这样一个效果‘#fixed’ 到达浏览器底部时候,固定在浏览器底端,当往上滚动时候,恢复。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
走同样的路,发现不同的人生