如何将广告始终定位到网页右下角

互联网提供了很多种“将广告始终定位到网页右下角”的解决方案,大多会用javascript

其实仅调用样式表就可以实现该效果

以下万恶的代码主要是写给IE6的,在IE7和FF浏览器中,只需要position:fixed就可以

将图层定义到网页的任意位置。

  必要元素
    DOCTYPE声明 、 html标签 、body标签 、 一个ID为test的div。


  相关样式:

    body{margin:0;border:0;height:100%;overflow-y:auto;}
#test{display:block; bottom:3px; right:3px; width:130px; position:fixed;}
/* 以下是写给IE6的 */
*html #test{position:absolute;right:18px}
*html{overflow-x:auto; overflow-y:hidden;}
posted @ 2011-09-13 17:55  jinrui  阅读(304)  评论(0编辑  收藏  举报