Reputation: 2758
As can be demonstrated in this fiddle, adding too many elements in a Bootstrap .nav
causes it to just add items vertically down. How would I go about limiting its height and making it horizontally scrollable?
Upvotes: 11
Views: 28080
Reputation: 118977
First you need to tell the ul
to not wrap and overflow into a scroll bar. Then the li
elements need to not be floated and display inline. This will do it:
ul.nav {
white-space: nowrap;
overflow-x: auto;
}
ul.nav li {
display: inline-block;
float: none;
}
Fiddle: http://jsfiddle.net/bmfcd3zt/8/
Upvotes: 29
Reputation: 1181
First, here is a fiddle that I've found on a scrolling implementation of tabs.
Second, I don't think that it's a good UX to provide so many links in a tabbar. I recommend you to use dropdown menus or mega menu.
Upvotes: 1