gpt4 book ai didi

css - 将导航菜单固定在页面顶部(Weebly)

转载 作者:行者123 更新时间:2023-11-28 10:11:49 32 4
gpt4 key购买 nike

我在 Weebly 上有一个网站,当您向下滚动时,该模板会导致导航菜单跟随您,使其在页面上的任何位置都可见。导航菜单挡住了我的内容,所以如果我能将它放在页面顶部就好了。

我正在尝试将代码粘贴到此处,但它的格式不正确,所以我将张贴它的图片:

/* Navigation
--------------------------------------------------------------------------------*/
.nav {
padding: 0 0 0 20px !important;
}
.nav ul{
list-style: none;
float:right;
overflow: hidden;
}
nav ul li {
list-style: none;
float:left;
margin-right:15px;
padding:8px 15px;
height:23px;
}
.nav ul li#active,
.nav ul li:hover {
border:2px solid #fff;
border-radius:4px;
padding:6px 13px;
}
.nav ul li a {
float:left;
display: block;
color:#fff;
text-decoration:none;
text-transform:uppercase;
font-weight: 500;
border: 0;
outline: 0;
list-style-type: none;
font-size:14px;
line-height:23px;
}
#nav-wrap .container ul li#active a,
#nav-wrap .container ul li a:hover {
color: #fff;
background: none !important;
border: 0;
}
.landing-page:before,
.splash-page:before,
.tall-header-page:before,
.short-header-page:before {
content: '';
width: 100%;
height: 130px;
position: fixed;
top: 0;
left: 0;
background: transparent url(‘menu-bg.png‘) left top repeat;
z-index: 1;
}

最佳答案

如果没有看到匹配的 HTML,我无法判断,但我相信从页面底部的选择器中删除 position: fixed 将解决您的问题。

您可以通过在每行前添加四个空格来格式化代码,这很容易做到:在记事本中选择所有内容,然后按 Tab 键。

关于css - 将导航菜单固定在页面顶部(Weebly),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24347856/

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