css - 如何编辑导航栏以使背景不可见?

标签 css

在我开始滚动之前,我似乎无法弄清楚为什么我的导航栏背景是不可见的。

我希望它一直是纯色。

这是代码:

#header {
padding: 20px 0px 10px!important;
transition: 0.5s;}

#header .logo img {
max-width: 250px;
max-height: 125px;}

.is-sticky #header {
z-index: 999999;
background: #404040;
border-bottom: 1px solid {{ baseColor }};}

#header .navigation {
max-width: auto;
max-height; auto;}

提前致谢!

最佳答案

您的站点中似乎有一些 js,在您滚动时将类 is-sticky 添加到 header 的父元素之一。

尝试将 background: #404040;.is-sticky #header 移动到 #header 样式:

#header {
  padding: 20px 0px 10px!important;
  transition: 0.5s;
  background: #404040;
}
#header .logo img {
  max-width: 250px;
  max-height: 125px;
}
.is-sticky #header {
  z-index: 999999;
  border-bottom: 1px solid {{ baseColor }};
}

以上假定 #header 是您正在谈论的导航栏

关于css - 如何编辑导航栏以使背景不可见?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31542806/

相关文章:

javascript - 在 d3 javascript 中的圆形对象中添加图像?

css - 将多个 less 文件编译成一个文件无法识别 variables.less 中的变量

javascript - 使用 jQuery 更改当前页面链接的 CSS

asp.net - css3 - 自定义下拉列表

html - 等高div容器

html - 以垂直顺序显示一些文本

javascript - HTML 和 CSS 新手 : Drop down menu not displaying

html - Chrome 不尊重表格元素的显示属性

html - 颜色:继承;不适用于 IE 或 EDGE 中的::选择

html - 粘性位置在 bootstrap 3 中不起作用