Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 当滚动我网站的一部分时,它会在我的标题上方而不是下方_Html_Css - Fatal编程技术网

Html 当滚动我网站的一部分时,它会在我的标题上方而不是下方

Html 当滚动我网站的一部分时,它会在我的标题上方而不是下方,html,css,Html,Css,这是我网站的主页。 但当我向下滚动时,内容框会在标题上方而不是下方。 这是我的密码: HTML <div class="Content-Box"> (First Box) </div> 添加z索引将使标题位于每个元素的顶部 将z-index:100添加到header您可能已经给了header绝对位置,或者您必须给header z-index:5或一些正整数值,或者给您的容器一个z-index:-5负值,以使header位于主体上方或将主体放在header后面您

这是我网站的主页。 但当我向下滚动时,内容框会在标题上方而不是下方。

这是我的密码:

HTML

<div class="Content-Box"> (First Box)
    </div>

添加
z索引
将使标题位于每个
元素的顶部


z-index:100
添加到
header

您可能已经给了header绝对位置,或者您必须给header z-index:5或一些正整数值,或者给您的容器一个z-index:-5负值,以使header位于主体上方或将主体放在header后面

您必须指定<代码>位置:固定< <代码> >代码> z索引< /代码>

尝试添加<代码> z索引:100 < /代码>如果您的问题得到解决,您应该考虑接受更多的答案。
.Content-Box {
position: relative;
margin: 0 auto;
background-color: white;
top: 65px;
padding: 45px;
height: -70px;
text-align: center;
box-shadow: 0px 3px 3px #888888;
}