Reputation:
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>
</ul>
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?
Upvotes: 100
Views: 290832
Reputation:
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.
Upvotes: 248
Reputation: 2411
As I found the default Bootstrap <hr/>
size unsightly, here's some simple HTML and CSS to balance out the element visually:
HTML:
<hr class="half-rule"/>
CSS:
.half-rule {
margin-left: 0;
text-align: left;
width: 50%;
}
Upvotes: 6
Reputation: 34652
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;
width:100%;
display:block; /* for use on default inline elements like span */
margin: 9px 0;
overflow: hidden;
background-color: #e5e5e5;
}
Upvotes: 17