我有標準的Bootstrap導航欄,並帶有class="justify-content-center"
。我希望這個導航欄一旦元素沒有足夠的空間就可以滾動。我的問題是,我只能向右滾動,而不能向左滾動。我一直在使用的以下代碼位於https://jsfiddle.net/rwx0xLm8/。使用Bootstrap 4 Alpha在小設備上製作可滾動的居中導航6
1
A
回答
1
檢查它的隊友。
<div class="container-fluid" style="width:100%">
<div class="row justify-content-center">
<ul class="nav">
<li class="nav-item"><a class="nav-link" href="#">Tab 1</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 2</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 3</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 4</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 5</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 6</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 7</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 8</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 9</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 10</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 11</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 12</a></li>
<li class="nav-item"><a class="nav-link" href="#">Tab 13</a></li>
</ul>
</div>
</div>
.nav {
overflow:auto;
text
}
.nav .nav-item a {white-space: nowrap;}
相關問題
- 1. 使用Bootstrap滾動的動畫/縮小導航欄4
- 2. Bootstrap 4 Alpha中的目標漢堡包導航摺疊6
- 3. Bootstrap 4 alpha 6響應表
- 4. Bootstrap Alpha 4導航欄上點擊不工作
- 5. 如何使用Flexbox在Bootstrap 4中居中導航欄
- 6. Bootstrap 4 alpha 6導航欄在谷歌瀏覽器上無法正確顯示
- 7. 將Bootbar中的導航欄內容居中放置4(alpha 5)
- 8. 在滾動條上縮小帶有徽標的Bootstrap導航條
- 9. bootstrap 4轉盤標題在小設備上不可見
- 10. Bootstrap滾動導航問題
- 11. Bootstrap - 導航欄滾動
- 12. 在小設備上修改導航欄
- 13. Bootstrap導航欄(粘貼導航欄)在滾動過程中調整大小
- 14. 引導4 - 在使用移動設備
- 15. Bootstrap列未在移動設備上居中
- 16. Bootstrap側導航禁用水平滾動
- 17. Bootstrap導航欄摺疊在桌面上正常工作,但在較小的設備上不能正常工作
- 18. Bootstrap 4兩條線上的導航
- 19. 爲什麼jQuery不能使用Bootstrap 4 alpha 6?
- 20. Angular 4 Bootstrap alpha導航欄無法正確呈現
- 21. Bootstrap 4(Alpha 6)列:col-x-n在表中被忽略?
- 22. Bootstrap居中(固定)導航欄
- 23. Bootstrap日期時間選取器不能與Bootstrap 4 Alpha 6
- 24. Bootstrap導航欄下拉不滾動
- 25. 固定導航欄在小型設備
- 26. Bootstrap靜態導航欄滾動
- 27. 滾動時隱藏bootstrap導航欄
- 28. Bootstrap導航欄頂部滾動
- 29. Bootstrap 4切換導航欄
- 30. Bootstrap 4導航欄顏色
需要你的位置是相對的嗎?把它放在一個絕對的容器裏,或者把絕對位置直接放在.nav中 – Sam
@Sam如果我將.nav設置爲'position:absolute;'整個導航都與左邊對齊,但我希望它位於中心。 。 – NeXuS