twitter-bootstrap 自定义引导程序导航栏的颜色?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15561041/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Customizing the color of bootstrap's navbar?
提问by JakeP
I haven't touched the core bootstrap files - in my own CSS I have the following:
我还没有触及核心引导文件 - 在我自己的 CSS 中,我有以下内容:
#menu-bar div {
border-color: #0072A6;
background-color: #0072A6;
margin: 0;
}
#menu-bar .navbar {
border-color: #0072A6;
background-color: #0072A6;
margin: 0;
}
#menu-bar .navbar-inner {
border-color: #0072A6;
background-color: #0072A6;
margin: 0;
height: 200px;
}
#menu-bar p, #menu-bar a {
color: white;
}
#menu-bar .active a {
color: white;
background-color: #0072A6;
}
This has gotten me where I want for screens > 1024px wide, however something in the responsive bootstrap css is causing this black border to wrap the menu for smaller screens:
这让我想要屏幕 > 1024px 宽,但是响应式引导 css 中的某些内容导致此黑色边框包裹较小屏幕的菜单:


Does anyone know how I can remove this? I've made a fiddle of it here including bootstrap to make it easier to play with:
有谁知道我如何删除它?我在这里做了一些修改,包括引导程序,以使其更容易使用:
I'm also trying to figure out how to customize that button color in case anyone's feeling super generous with their time.
我还试图弄清楚如何自定义按钮颜色,以防有人对他们的时间感到非常慷慨。
回答by Omega
.navbar-inverse .btn-navbaris what defines your button color.
.navbar-inverse .btn-navbar是什么定义了您的按钮颜色。
.navbar-inverse .navbar-inneris what defines the black border.
.navbar-inverse .navbar-inner是什么定义了黑色边框。
回答by adrianbanks
Add background-image: none;to your #menu-bar .navbar-innerstyle. This will override the bootstrap style that is giving the black border (.navbar-inverse .navbar-innerin bootstrap-combined.css).
添加background-image: none;到您的#menu-bar .navbar-inner风格。这将覆盖提供黑色边框的引导程序样式(.navbar-inverse .navbar-inner在 bootstrap-combined.css 中)。
To change the colour of the button, override the .navbar-inverse .btn-navbarstyle:
要更改按钮的颜色,请覆盖.navbar-inverse .btn-navbar样式:
.navbar-inverse .btn-navbar
{
background: red;
}

