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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 23:35:40  来源:igfitidea点击:

twitter bootstrap button group with transparent background

csstwitter-bootstrap

提问by sheno

I have a button group using twitter bootstrap as you see here:

正如您在此处看到的,我有一个使用 twitter bootstrap 的按钮组:

http://jsfiddle.net/rmk7H/

http://jsfiddle.net/rmk7H/

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 mynavclass. How should I modify mynavclass?

这让我很烦。我希望它通过添加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 atransparent add this

您需要使a透明的背景添加此

.mynav > a {
    background:none;
    border:none;
    box-shadow:none;
}

http://jsfiddle.net/rmk7H/2/

http://jsfiddle.net/rmk7H/2/

回答by UrGuardian4ngel

Transparant, like this?

透明,就这样?

.mynav .btn
{
    background-image: none;
}