【问题标题】:Anything like "Stay on Top" in Web Programming?Web 编程中的“保持领先”之类的东西?
【发布时间】:2010-12-12 20:18:11
【问题描述】:

嗯,

我遇到了一个新问题。

我有两个元素固定在页面的顶部和底部。它们之间的元素与顶部元素重叠。

我确实将它们都固定了。但这似乎仍在发生,所以我想知道 CSS 中是否有类似“Stay on Top”属性的东西?或用 A 语言..

http://www.searchr.us/web-search.phtml?search=Test

这是一张照片

http://i.stack.imgur.com/D4W4p.gif

如你所见,我的框架正在我的标题上方。

如果有帮助:http://www.searchr.us/css/style.css

谢谢

【问题讨论】:

    标签: javascript html css iframe


    【解决方案1】:

    查看您的 css 的 z-index

    #header {
        background : url(http://www.searchr.us/images/header.png);
        background-repeat : repeat-x;
        height : 44px;
        min-width : 890px;
        position : fixed;
        top : 0;
        left : 0;
        width : 100%;
        z-index : 1000; /*<---makes sure it's over EVERYTHING*/
    }
    

    【讨论】:

      【解决方案2】:

      Add a z-index 更高,例如:

      #header { z-index: 10; }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-11-21
        • 1970-01-01
        • 2012-05-19
        • 2017-09-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多