在导航栏固定菜单栏 Bootstrap 中更改背景颜色 [英] Change background color in navbar fixed menu bar Bootstrap
本文介绍了在导航栏固定菜单栏 Bootstrap 中更改背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在 Bootstrap 中更改导航栏固定菜单栏的颜色.在 application.css.scss 我有这个:
I'd like to change the color of my navbar fixed menu bar in Bootstrap. In application.css.scss I have this:
.navbar
.navbar-inner {
background-color: #2c2c2c;
}
}
在 application.html.erb 我有这个:
In application.html.erb I have this:
<header class="navbar navbar-inverse navbar-fixed-top">
<nav class="navbar-inner">
有人可以解释为什么我仍然看到黑色作为菜单栏背景(我怀疑我没有完全匹配这些类).
Could someone explain why I'm still seeing black as the menu bar background (I suspect I am not matching the classes quite right).
推荐答案
默认情况下,导航栏使用 css 渐变.这使用 background-image
属性.您还需要重置此值:
By default, the nav bar uses a css gradient. This uses the background-image
property. You will need to reset this value as well:
.navbar {
.navbar-inner {
background-color: #2c2c2c;
background-image: none;
}
}
更新:添加了缺失的大括号.
Update: Added missing brace.
这篇关于在导航栏固定菜单栏 Bootstrap 中更改背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文