简体   繁体   English

Twitter Bootstrap响应式导航(btn-navbar,图标栏)颜色更改

[英]Twitter Bootstrap Responsive Navigation (btn-navbar, icon-bar) color changes

I'm working with Bootstrap and focusing on the mobile navigation. 我正在与Bootstrap合作,专注于移动导航。 When hovered over, the icon (three horizontal lines) has a grey background color; 将鼠标悬停在该图标上时(水平的三行)为灰色背景色; however, the background color only goes halfway up the icon (see image). 但是,背景颜色仅位于图标的中间(参见图片)。 I don't mind this background color but I'd like to to be over the full icon with rounded edges on top as they are on the bottom. 我不介意这种背景色,但我想放在整个图标上,并在顶部加上圆角,因为它们在底部。 How can I make this happen? 我怎样才能做到这一点? Any ideas/suggestions appreciated. 任何想法/建议表示赞赏。

在此处输入图片说明

You need to change to Icon Bar color, showed in: 您需要更改为图标栏颜色,显示为:

<span class="icon-bar"></span>

Set the Color you would like to have with CSS 使用CSS设置您想要的颜色

.navbar-default .navbar-toggle .icon-bar {
    background-color: #fff;
}

And you can also set the Background Color of the Button. 您还可以设置按钮的背景色。

.navbar-toggle {
    background-color: #666;
}

If you want to Change the Color on Focus, then just adjust the :focus Tag in Bootstrap: 如果要更改焦点颜色,则只需在Bootstrap中调整:focus标签:

.navbar-toggle:focus {

// set the new color here for focus

}

and

.navbar-toggle:focus .icon-bar {

// here for the 3 white Stripes

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM