gpt4 book ai didi

html - 为什么位置固定不起作用?

转载 作者:太空宇宙 更新时间:2023-11-03 23:32:31 25 4
gpt4 key购买 nike

我只是想将页眉贴在顶部。我已将 position 设置为 fixedtop:0px;left:0px

我已经上传my code here .

下面是标题的 CSS 类:

header.header
{
background: #861912;
padding:5px 10px;
overflow: hidden;
height: 43px;
position: fixed;
width: 100%;
top: 0px;
left: 0px;
}

请帮我找出是什么阻止我的标题停留在顶部。

最佳答案

只需将 Navbar 放在其他 div 之外并直接放在 body 内并增加它的 z-index,这样它就可以正常工作。

关于html - 为什么位置固定不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24934108/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com