Mike6679
Mike6679

Reputation: 6117

Twitter Bootstrap Tabs: How to: Increase spacing between tabs

I'm using ui bootstrap for angular (which uses twitter bootstrap css). I was able to center the tabs, but I cannot figure out how to add spacing (margins) between the tabs (RIGHT OR LEFT). I tried adding margin-right: 100px; in .nav-tabs > li but that did not work.

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;

        }

Upvotes: 3

Views: 16584

Answers (2)

Mike6679
Mike6679

Reputation: 6117

Adding margin-right & margin-left to .tabbable ul li created the margins I needed. Thanks to Bass Jobsen for pointing me in the right direction.

.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;
            }

Upvotes: 0

Bass Jobsen
Bass Jobsen

Reputation: 49044

Set margin-left and margin-right of .nav-tabs > li > a, .nav-pills > li > a. The margin-right is 2px by default.

b.e:

    .nav-tabs > li > a, .nav-pills > li > a {margin-left:25px;margin-right:27px;}

Upvotes: 10

Related Questions