IE6 position:fixed 固定定位問題,positionfixed

來源:互聯網
上載者:User

IE6 position:fixed 固定定位問題,positionfixed
IE6下 position:fixed失效,解決方案如下:
除了IE6的瀏覽器.top {
    width: 97px;
    height: 278px;
    background: #e0c157;
    position: fixed;
    z-index: 30000;
    /*    控制左右位置*/
    right: 50px;
    margin-bottom: 10px; 
}
針對IE6使元素固定在瀏覽器的頂部

.top{    
    _position:absolute;    _bottom:auto;    _top:expression(eval(document.documentElement.scrollTop));}
針對IE6使元素固定在瀏覽器的底部
.top{      _position:absolute;    _bottom:auto;    _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));}
使用 margin-top:10px; 或者 margin-bottom:10px; 修改其中的數值控制元素的位置。

position:fixed; 閃動問題

現在,問題還沒有完全解決。在用了上面的辦法後,你會發現:被固定定位的元素在滾動捲軸的時候會閃動。解決閃動問題的辦法是在 CSS 檔案中加入:

*html{      background-image:url(about:blank);    background-attachment:fixed;}

其中 * 是給 IE6 識別的。


效果如:



詳細請看http://loo2k.com/blog/ie6-position-fixed/


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.