Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keeping a navbar ul horizontal on small screens

I have a Bootstrap navbar that has 2 ul's in it.

the first UL hides into the collapse menu on small screens.

the second UL is still visible.

the problem i've run into, is that second UL always displays vertically. i can't seem to override it to display horizontally. i keep inspecting the css , but nothing i've found seems to control that.

http://www.bootply.com/render/121627

( some of the css is borrowed from // Twitter bootstrap 3 navbar navbar-right outside navbar-collapse )

To clarify:

this is what I see on <760px wide screens:

 [ brand ]     -item1      [---]
               -item2

this is what i want to see:

 [ brand ] -item1 -item2  [---]
like image 313
Jonathan Vanasco Avatar asked Mar 13 '14 16:03

Jonathan Vanasco


2 Answers

the solution was to target the ul>li on the navbar.

.navbar-right > ul > li { float:left; }
like image 88
Jonathan Vanasco Avatar answered Sep 20 '22 22:09

Jonathan Vanasco


This is what worked for me in a similar situation:

.navbar-right {
    float: right;
}

.navbar-right > li {
    float: left
}

.navbar-right > li > a {
    display: block;
}
like image 38
t.m. Avatar answered Sep 21 '22 22:09

t.m.