html - 当我滚动时,我的主 Logo 横幅出现在我的导航栏中

标签 html css navbar

我已经为我的导航栏指定了固定位置和 1 的 z-index。当我滚动时它保持在顶部,这很好,但是当它向上滚动时我的 Logo 不会在它后面,它仍然可以在我真的不想要的导航区域中看到。下面是我的 Logo 的 css。我还在学习网页设计。谢谢。

#logo {
    background-color: #292421;
    color: white;
    margin-top: 70px;
    padding: 40px 0 25px;
}
#nav_bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1;
    background: url(..images/header-fade.gif) repeat-x;
    border-bottom: 1px solid #ccc;
}

最佳答案

您的#nav_bar 没有背景。您提供的网址不正确。你可能希望它是

background: url(../images/header-fade.gif) repeat-x;

请注意,您在点 .. 之后错过了斜杠字符 /

关于html - 当我滚动时,我的主 Logo 横幅出现在我的导航栏中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19859912/

相关文章:

javascript - CSS 过滤器破坏 3D 变换

javascript - 我的 Bootstrap 导航栏未显示在移动设备上

html - 为什么我的导航栏链接的颜色不会改变

javascript - navigator.geolocation.watchPosition - 频率

html - 当没有祖先指定高度时垂直居中 div

html - 使用 Bootstrap 通过响应式设计将页脚保持在底部

html - 导航栏反转的透明度

css - 响应式 Bootstrap 导航栏中的下拉菜单

html - 如何在 Sass 中将具有相同类的 html 元素堆叠在一起

jquery - 如何删除滚动条以使网站适合浏览器