日期:2014-05-17  浏览次数:20588 次

求一个浮动广告框的CSS写法
就是能固定在页面的某个位置,不随页面滚动而滚动的那种!

------解决方案--------------------
HTML code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>IE6 position:fixed</title>
<style type="text/css">
* { margin:0; padding:0;}
#content{ height:2000px; }
#a{ position:fixed; bottom:0; right:0; width:200px; height:60px; background:#F00;}
/*IE6 fixed bug*/
* html{overflow:hidden;}
* html body{height:100%;overflow:auto;}
* html #a{position:absolute;right:18px;}
</style>
</head>

<body>
<div id="content">
IE6 position:fixed
</div>
<div id="a">IE6 position:fixed</div>
</body>
</html>

------解决方案--------------------
我有个现成的写法,从 Discuz 论坛程序里面copy的,具体你可以看看:http://www.bacysoft.cn/thread-56-1-1.html
------解决方案--------------------
用position:fixed; calmcrime的方法行
------解决方案--------------------
calmcrime已经回答的很好了,只是JS方式这里需要加上原来的高度
window.onscroll = function()
{
$('test').style.top = 原高度+ (document.documentElement.scrollTop || document.body.scrollTop) + 'px' 
 }
------解决方案--------------------
学习了。
探讨

HTML code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equ……

------解决方案--------------------
增加点人气~~~
------解决方案--------------------
用CSS多好。。。