CSS 具有透明背景的 twitter bootstrap 按钮组
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17762654/
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
twitter bootstrap button group with transparent background
提问by sheno
I have a button group using twitter bootstrap as you see here:
正如您在此处看到的,我有一个使用 twitter bootstrap 的按钮组:
It makes a linear-gradient background:
它制作了一个线性渐变背景:
linear-gradient(to bottom, #FFFFFF, #E6E6E6)
which is annoying me. I want it to have a transparent background by adding mynav
class. How should I modify mynav
class?
这让我很烦。我希望它通过添加mynav
类具有透明背景。我应该如何修改mynav
类?
HTML:
HTML:
<div class="btn-group mynav">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
Username
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<ul class="nav nav-list">
<li class="nav-header">List header</li>
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Library</a></li>
...
</ul>
</ul>
</div>
CSS:
CSS:
.mynav
{
}
回答by jamcoupe
You need to make the background of the a
transparent add this
您需要使a
透明的背景添加此
.mynav > a {
background:none;
border:none;
box-shadow:none;
}
回答by UrGuardian4ngel
Transparant, like this?
透明,就这样?
.mynav .btn
{
background-image: none;
}