跨瀏覽器的CSS固定定位

來源:互聯網
上載者:User
1. IE7、Firefox、Opera,都支援CSS的{position:fixed},所以很容易實現。
    不過這裡有個小問題的,今天做個右下的div,設定的css樣式是{position:fixed;right:0px;bottom:0px;},結果怎麼調整div的水平位置在ff都是置中,在IE7能正常顯示,調了很長時間,結果是div的的css缺少了width屬性,添加上後一切OK!

2、IE6不支援fixed,可以利用容器對溢出內容的處理方式來實現的

<!--[if IE 6]>
<style type="text/css">
html{overflow:hidden;}
body{height:100%;overflow:auto;}
#BottomList{position:absolute;right:0px;}
</style>
<![endif]-->



相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.