html - Bootstrap horizontal drop down -


take @ picture:

example http://i42.tinypic.com/wvbf3a.png

i want dropdown menu items stack left right (horizontally). cannot seem work, tried using "list-inline" class mentioned in official documentation, makes things worse.

here's html:

<nav class="navbar navbar-default navbar-static-top" role="navigation">     <ul class="nav navbar-nav">         <li class="dropdown">             <a href="#" class="dropdown-toggle" data-toggle="dropdown">list item</a>             <ul class="dropdown-menu">                 <li><a href="#" id="">1</a></li>                 <li><a href="#" id="">2</a></li>                 <li><a href="#" id="">1</a></li>                 <li><a href="#" id="">2</a></li>                 <li><a href="#" id="">3</a></li>                 <li><a href="#" id="">4</a></li>                 <li><a href="#" id="">5</a></li>                 <li><a href="#" id="">6</a></li>             </ul>         </li>     </ul> </nav>   

i'm using bootstrap 3

enclose li ul list , class list-inline this

<ul class="dropdown-menu">                 <ul class='list-inline'>                     <li><a href="#" id="">1</a>                     </li>                     <li><a href="#" id="">2</a>                     </li>                     <li><a href="#" id="">3</a>                     </li>                     <li><a href="#" id="">4</a>                     </li>                     <li><a href="#" id="">5</a>                     </li>                 </ul> </ul> 

check screenshot

enter image description here

here jsfiddle

updates1:

as mentioned in comments, class: dropdown-menu has min-width 160px. hence fixed width. try override it.

enter image description here

updates2:

as mentioned in comments, bootstrap has default style can overridden like

.dropdown-menu{ min-width: 200px; } 

incase if feel affects other elements override using id selector.

#numberlist.dropdown-menu{ min-width: 200px; } 

find difference in jsfiddle


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -