Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertical divider doesn't work in Bootstrap 3

I opened the Nav example which comes with the standard Bootstrap download (bootstrap-3.0.0\examples\navbar\index.html) and added vertical dividers between two of the links.

However, it doesn't seem to make any difference to the navigation bar:

<div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Link1</a></li> <li><a href="#">Link2</a></li> <li class="divider-vertical"></li> <li><a href="#">Link3</a></li> 
like image 595
Sig 226 Avatar asked Oct 05 '13 23:10

Sig 226


People also ask

How do I make a vertical line responsive?

To make a vertical line, use border-left or border-right property. The height property is used to set the height of border (vertical line) element. Position property is used to set the position of vertical line.

How do you make a vertical HR?

hr elements will automatically become vertical. You just need to set it's height property (e.g. height: 80%;).

How do I put a vertical line between two divs?

You can use <hr> , as it is semantically correct, and then use CSS to convert it to a vertical line.


2 Answers

I think this will bring it back using 3.0

.navbar .divider-vertical {     height: 50px;     margin: 0 9px;     border-right: 1px solid #ffffff;     border-left: 1px solid #f2f2f2; }  .navbar-inverse .divider-vertical {     border-right-color: #222222;     border-left-color: #111111; }  @media (max-width: 767px) {     .navbar-collapse .nav > .divider-vertical {         display: none;      } } 
like image 177
Sergey Barskiy Avatar answered Oct 07 '22 18:10

Sergey Barskiy


.divider-vertical { height: 50px; margin: 0 9px; border-left: 1px solid #F2F2F2; border-right: 1px solid #FFF; } 

and now you can use it

<ul>     <li class="divider-vertical"></li> </ul> 
like image 22
john Avatar answered Oct 07 '22 20:10

john