Twitter Bootstrap选项卡:如何:增加选项卡之间的间距

时间:2013-06-03 22:07:07

标签: twitter-bootstrap tabs margins

我正在使用ui bootstrap for angular(使用twitter bootstrap css)。我能够使标签居中,但我无法弄清楚如何在标签之间添加间距(边距)(右或左)。我尝试添加margin-right:100px;在.nav-tabs>但是那没用。

Html:

<html>
    <body>

               <tabbed-Panel class="bottomTabPanel">
            <!--<div data-fade="1" ngModel="activeTab" bs-Tabs>-->
            <tabs>
                <pane ng-repeat="pane in panes" heading="{{pane.title}}"  active="pane.active">
                    <div ng-include src="activeContent()"></div>
                </pane>
            </tabs>
            <!--</div>-->
        </tabbed-Panel>
            </div
    </body>
</html>

Css

.bottomTabPanel{

    position:absolute;
    bottom:-12px;
    display:block;  
    background-color:#666666;
    padding-left: 75px;
    padding-right: 75px;
}
    /*Bottom tab panel style: */
    .nav-tabs>li>a {
        height:73px;
        width: 131px;
        border: 1px solid transparent;
        -webkit-border-radius: 0px 0px 0 0;
        -moz-border-radius: 0px 0px 0 0;
        border-radius: 0px 0px 0 0;
        color: #5261ac;
        font-size: 19px;
        font-weight:bold;
        background-color:#c2c8e4;


     }

     .nav-tabs>.active>a, .nav-tabs>.active {
        color: #ffffff;
        cursor: default;
        background-color:#ed174f;
        border:none;
     }
      /* center tabs in container */
     .nav-tabs > li {
        float:none;
        display:inline-block;
        margin-right: 100px;
     }
     .nav-tabs {
        text-align:center;
     }

      /* for centering text in the tab*/
     .tabbable ul {
            display:table-row;
        }
        .tabbable ul li
        {
            display: table-cell;
            list-style-type: none;
            vertical-align: middle;
            /*margin left & right here fixed the issue! */
            margin-right: 16px;
            margin-left: 16px;
        }
        .tabbable ul li a {
            display:table-cell;
            vertical-align: middle;
            text-align:center;

        }

2 个答案:

答案 0 :(得分:8)

设置margin-left的{​​{1}}和margin-right.nav-tabs > li > a, .nav-pills > li > a默认为2px。

b.e:

margin-right

答案 1 :(得分:0)

添加保证金权利&amp; margin-left to .tabbable ul li创造了我需要的边距。感谢Bass Jobsen指出我正确的方向。

.tabbable ul li
            {
                display: table-cell;
                list-style-type: none;
                vertical-align: middle;
                /*margin left & right here fixed the issue! */
                margin-right: 16px;
                margin-left: 16px;
            }