2014-03-31 80 views
1

我不能得到這個工作。bootstrap navbar如何給它一個最大寬度

我有一個導航欄

<div class="container"> 
    <div class="navbar"> 
    <div class="navbar-inner"> 
     <div class="pull-right"> 
     <button class="btn btn-small btn-primary">Nieuwe medewerker</button> 
     </div> 
    </div> 
    </div> 
</div> 

現在,這是一個很好的酒吧寬度容器的寬度,它在中東爲中心的,正是我想要的。

現在我想要將這個確切的條固定到底部,但是當我添加navbar-fixed-bottom時,它會自動延伸到我的窗口大小。

<div class="navbar navbar-fixed-bottom"> 

我一直在試圖調整CSS,但無法讓它工作。有人有如何做到這一點的想法。

感謝

回答

2

navbar-fixed-bottom使用position:fixed所以它從頁面的流量刪除,不再擔任寬度它的容器。

你可能反而讓另一個類(即,導航欄底部),並使用絕對位置來放置在底部...

.navbar-bottom { 
    position:absolute; 
    bottom:0; 
    width:90%; 
    margin-bottom:0; 
} 

演示:http://www.bootply.com/126172