【问题标题】:css position:fixed not working in iecss位置:固定在ie中不起作用
【发布时间】:2013-12-11 23:17:11
【问题描述】:

我有一个位置固定的 div,其中我有一个绝对位置的 div....

绝对定位的 div 正在工作.....但是 position:fixed 在 ie 中不起作用............

希望你能理解...

HTML

   <div class="container">
<div class="cont_left">
    <div style="position:relative">
    <div id="nav">
    <div style="display: block;" class="menu"> <a href="#">
            about
            </a>
        </div>
    <div style="display: block;" class="menu"> <a href="#">
            services
            </a>
        </div>

        ......

        </div>
    </div></div></div>

CSS

.container{
    width:100%;
    float:left;
}
.cont_left{
    width:164px;
    float:left;
    padding:0;
    position:fixed;
}

#nav{
    width:164px;
    float:left;
    padding:0;
    list-style:none;
    margin:58px 0 46px 0;
    position:absolute;
    top:0;
    left:0;
}

【问题讨论】:

  • IE6 我猜? IE7 正确实现了position:fixed。 IE6 不理解位置:相对。恢复位置:静态
  • 我从几乎所有网站上听说,如果使用 IE,某些项目会出现问题。我正在使用 FF 来解决我的问题。

标签: html css internet-explorer


【解决方案1】:

你可以试试这个:http://ryanfait.com/position-fixed-ie6/

【讨论】:

    【解决方案2】:

    只需将&lt;!doctype html&gt; 添加到您的html 顶部

    【讨论】:

      【解决方案3】:

      如果您使用 XHTML 而不是 HTML,那么 position:fixed 肯定是可行的。 在您的 HTML 页面开始时,您必须添加

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      

      【讨论】:

        猜你喜欢
        • 2015-11-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-05-30
        • 2019-03-20
        • 2014-05-10
        • 1970-01-01
        • 2011-11-17
        相关资源
        最近更新 更多