2014-04-28 44 views
0

我正在使用包含3個元素的引導程序導航欄。
我希望它分佈在整個導航欄中,但它不是。bootsrap navbar中的項目數

下面是代碼:

<div class="navbar steps" style="position:relative;z-index:7"> 
    <div class="navbar-inner"> 
     <ul class="row-fluid nav nav-pills"> 
      <li class="span3 active"> 
       <a href="#tab1" data-toggle="tab" class="step active"> 
        <span class="number">1</span> 
        <span class="desc"><i class="icon-ok"></i> Source</span> 
       </a> 
      </li> 
      <li class="span3"> 
       <a href="#tab2" data-toggle="tab" class="step"> 
        <span class="number">2</span> 
        <span class="desc"><i class="icon-ok"></i> Détail</span> 
       </a> 
      </li> 
      <li class="span3"> 
       <a href="#tab3" data-toggle="tab" class="step"> 
        <span class="number">3</span> 
        <span class="desc"><i class="icon-cog"></i> Configuration</span> 
       </a> 
      </li> 

     </ul> 
    </div> 
</div> 
+1

應該span4 ... –

+0

其引導的版本,您使用的? – Sachin

+0

看看這個例子http://getbootstrap.com/2.3.2/examples/justified-nav.html – fasouto

回答

0

Bootstrap grids內置斷12列布局。如果您想要三個項目佔據整個寬度,請使用span4(= 12/)。

嘗試更改span3span4

Here's a Demo in jsFiddle

應該看看哪些是這樣的:

screenshot

代碼:

<div class="navbar steps" style="position:relative;z-index:7"> 
    <div class="navbar-inner"> 
     <ul class="row-fluid nav nav-pills"> 
      <li class="span4 active"> 
       <a href="#tab1" data-toggle="tab" class="step active"> 
        <span class="number">1</span> 
        <span class="desc"> 
         <i class="icon-ok"></i> 
         Source 
        </span> 
       </a> 
      </li> 
      <li class="span4"> 
       <a href="#tab2" data-toggle="tab" class="step"> 
        <span class="number">2</span> 
        <span class="desc"> 
         <i class="icon-ok"></i> 
         Détail 
        </span> 
       </a> 
      </li> 
      <li class="span4"> 
       <a href="#tab3" data-toggle="tab" class="step"> 
        <span class="number">3</span> 
        <span class="desc"> 
         <i class="icon-cog"></i> 
         Configuration 
        </span> 
       </a> 
      </li> 

     </ul> 
    </div> 
</div> 

選項2

正如fasouto指出的那樣,您也可以嘗試使用justified navbar

Here's a Justified Demo