ERIC岛

ERIC的技术博客...
    <<  ie6 img边缘空白 | 首页 | 支持IE6的position:fixed 纯CSS 多浏览器兼容  >>
  • 关于CSS在浏览器中固定定位position:fixed的应用

    日期:2009-06-23 | 分类:互联网

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://ericneo.blogbus.com/logs/41394849.html

    对于样式position:fixed,IE7及大多数浏览器都有用,而对于IE6及以下版本,并不能应用!
    对于页面固定标签<div id="top">
    <a href="#top11" title="回到页眉">回到页眉</a></div>的应用。
    IE7及其他浏览起可以这样设置样式:
    <style type="text/css">
    #top{position:fixed; bottom:0;right:0;height:34px;width:34px;}
    #top a{display:block;height:35px;width:35px;text-indent:-9999px;background:url([url]http://dancewithnet.com/wp-content/themes/dancewithnet/img/symbols.png[/url]) no-repeat 0 -600px;}
    #top a:hover{border:none;background:url([url]http://dancewithnet.com/wp-content/themes/dancewithnet/img/symbols.png[/url]) no-repeat 0 -635px;}
    </style>
    而对于IE6浏览器的兼容需要加上声明:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    及样式:
    <style type="text/css">
    html{overflow:hidden;}
    body{height:100%;overflow:auto;}
    #top{position:absolute;right:17px;}
    </style>
    这样就是实现绝大部分浏览器兼容(不包括IE5以下)

    本文出自 “开拓世界领先的WEB技术” 博客


    历史上的今天:

    支持IE6的position:fixed 纯CSS 多浏览器兼容 2009-06-23
    ie6 img边缘空白 2009-06-23

    随机文章:

    【IE6 BUG大全】position:fixed在IE6下的实现 2009-06-30
    兼容火狐和IE的加入收藏夹/设为首页代码 2009-11-12
    绝对定位和相对定位 2009-05-30
    转:如何去除横向滚动条 2009-05-13
    DW快捷键 2009-04-22

    收藏到:Del.icio.us




    Tags:固定定位 position:fixed
    ERIC 发表于10:41:09 | 编辑 | 继续话题 | 转发 | 分享 0
    引用地址:

Subscribe to feed

Subscribe to feed

日历

  • RSS 什么是RSS?
    用IM提醒我内容更新
    订阅到QQ邮箱
    订阅到鲜果阅读器
    订阅到Google阅读器
    订阅到抓虾阅读器
  • 《城客》第四期:创意之城
    博客大巴
    博客大巴使用指南
    博客大巴模板中心
    免费注册博客大巴
    一键博客搬家工具
    中文互动杂志城客
^ 返回顶部
Copyright © 2002-2009 BlogBus.com, All Rights Reserved. 博客大巴 版权所有
博客大巴模板设计:Climbing | 作者:Shiney
    iCity YOHOcity