我的情况:
我有一个固定的标题,当我向下滚动时,标题会保留在原位。在页脚之前,我在底部有一个div。该DIV包含Disqus评论系统。

问题是:

每当我在底部向下滚动时,DIV就会按预期(在标题下方)顺利运行,但Disqus评论系统会在标题上方,而标题应该位于标题下方。

div的代码和注释模板的调用函数在下面:

<div class="comments-template" style="position:inherit;">
<?php comments_template(); ?>
</div>


以下是DIV和Disqus评论系统的CSS代码:

.comments-template{
    width: 1040px;
    position: static;
    margin: auto;
    clear:both;
    background-color:#CCC;

}

#disqus_thread {
    color: #FFF;
    padding: 5px;
    margin: auto;
    clear:both;
    position:static;
}

.dsq-comment-header {
    background-color: 2d2d2d;
    font-family:"Arial",sans-serif;
    font-size: 12px;
    height: 50px;
    position:static;
    clear:both;
    }

.dsq-comment-message {
    font-family:"Tahoma",sans-serif;
    font-size: 11px;
    color: #333;

    }
textarea {
    background-image: none;
    background-repeat: repeat;
    border:  #666 2px solid; /* light blue border */

    }
.dsq-comment {
    border: #666 2px solid; /* light blue border */
    margin-bottom: 15px;

    }


我希望你能帮助我解决我的问题。

先感谢您!

最佳答案

给您的标题更高的z-index

header {
  z-index: 5;
}

关于css - 我的 header 处于固定位置,我遇到了Disqus问题。,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7313443/

10-12 16:48
查看更多