简体   繁体   English

删除Bootstrap 3选项卡之间的空间

[英]Removing space between Bootstrap 3 tabs

firstly here's the fiddle: http://jsfiddle.net/krish7878/a2f03jrg/ 首先是小提琴: http : //jsfiddle.net/krish7878/a2f03jrg/

Nothing fancy going on, just the regular bootstrap 3 tabs with background color. 没什么好想的,只有常规的带有背景色的自举3标签。 There seems to be a 1px space on either side of each tab and I cannot remove it. 每个标签的两边似乎都有1px的空间,我无法删除它。 I've tried 'margin,padding: 0px', 'float:left'. 我尝试过'margin,padding:0px','float:left'。

Any help would be appreciated. 任何帮助,将不胜感激。

HTML Code: HTML代码:

  <ul class="nav nav-tabs" role="tablist">
    <li class="active"><a href="#popular" role="tab" data-toggle="tab">Popular</a></li>
    <li><a href="#recent" role="tab" data-toggle="tab">Recent</a></li>
    <li><a href="#comments" role="tab" data-toggle="tab">Comments</a></li>
  </ul><!-- /.nav-tabs -->
  <!-- Tab panes -->
  <div class="tab-content">
    <div class="tab-pane fade in active" id="popular">
        popular - some content will go in here
    </div><!-- /.tab-pane -->
    <div class="tab-pane fade" id="recent">
        Some Content Will obviously come here
    </div><!-- /.tab-pane -->
    <div class="tab-pane fade" id="comments">
        Some Content Will obviously come here
    </div><!-- /.tab-pane -->
  </div><!-- /.tab-content -->

CSS code: CSS代码:

ul.nav-tabs li.active a{
border-top: 3px solid #49c8ff;
border-radius: 2px;
}
ul.nav-tabs li.active:hover a{
    border-top: 3px solid #49c8ff;
}
ul.nav-tabs li a{
    background-color: #eee;
}

The margin around the links is coming from this rule in the bootstrap stylesheet: 链接周围的空白来自引导样式表中的以下规则:

.nav-tabs>li>a {
   margin-right: 2px;
}

You can override with something like: 您可以使用以下内容覆盖:

ul.nav-tabs li a{
    background-color: #eee;
    margin-right: 0;
}

Updated fiddle: http://jsfiddle.net/a2f03jrg/1/ 更新的提琴: http : //jsfiddle.net/a2f03jrg/1/

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

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