Bootstrap 3 Horizontal Divider (not in a dropdown)


I know Bootstrap 3 has a horizontal divider you can place inside of dropdown menus to separate links like this:

<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu2">
  <li role="presentation" class="dropdown-header">Dropdown header</li>
  <li role="presentation" class="divider"></li>

My question is: Is there any way to do this without it being in a dropdown, such as putting it into any kind of list or similar menu?

This question is tagged with twitter-bootstrap twitter-bootstrap-3

~ Asked on 2014-10-26 07:53:12

The Best Answer is


Yes there is, you can simply put <hr> in your code where you want it, I already use it in one of my admin panel side bar.

~ Answered on 2014-10-26 16:44:25


Currently it only works for the .dropdown-menu:

.dropdown-menu .divider {
  height: 1px;
  margin: 9px 0;
  overflow: hidden;
  background-color: #e5e5e5;

If you want it for other use, in your own css, following the bootstrap.css create another one:

.divider {
  height: 1px;
  display:block; /* for use on default inline elements like span */
  margin: 9px 0;
  overflow: hidden;
  background-color: #e5e5e5;

~ Answered on 2014-10-26 16:56:29

Most Viewed Questions: