【问题标题】:Sticky footer not working in IE粘滞页脚在 IE 中不起作用
【发布时间】:2012-07-10 17:53:01
【问题描述】:

我为我的网站创建了一个 Sticky 页脚,您可以在这个小提琴中查看它:http://jsfiddle.net/Aw6vn/

#main_Ticker{
    position: fixed;
    bottom: 0; 
    right: 12%;
    z-index: 6000 !important;
}

它适用于 jsfiddle 中的所有浏览器,但是当我将代码放在我的页面中时,它在 IE8-9 中不起作用:

http://s-maof.com/PRO/index2.php?fkapp=2

我也试过了:

position: absolute; bottom: 0; right: 12%;

没有做到这一点。

感谢“我的头疼”,解决方案是 编辑掉注释的标题

<!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">-->
<!--<!DOCTYPE HTML>-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

谢谢!

【问题讨论】:

    标签: css internet-explorer css-position computability


    【解决方案1】:

    删除 !Doctype 之前的 cmets,因为这些会强制 IE 进入怪癖模式 (see here)

    <!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">-->
    <!--<!DOCTYPE HTML>-->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    

    【讨论】:

      【解决方案2】:

      按照您的风格添加以下内容并尝试:

      <style>
          *html, body {
              height: 100%;
          }
      </style>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-07-01
        • 2015-01-14
        • 2014-08-02
        • 2014-12-21
        • 2015-05-04
        • 1970-01-01
        相关资源
        最近更新 更多