twitter bootstrap - How to stretch .divider (for nav) 100% to width of container? -
how can stretch black .divider entire width of container?
setting width 100% not working of course inner container has margins set accordingly. how can set width outer container margins looks it's 100% stretched across nav container?
fiddle: http://jsfiddle.net/w3dh3/
<div class="well sidebar-nav left"> <ul class="nav nav-list"> <li class="divider"></li> // <-- how stretch 100% outer container margins <li class="nav-header">sidebar</li> <li class="active"><a href="#">link</a></li> <li><a href="#">link</a></li> <li><a href="#">link</a></li> <li><a href="#">link</a></li> </ul> </div><!--/.well --> </div><!--/span--> </div><!--/row-->
body { padding-top: 60px; padding-bottom: 40px; } .sidebar-nav { padding: 9px 0; } .row-fluid > .sidebar-nav { width: 220px; } .left { float:left; } .divider { border-top: 1px solid #000 !important; border-bottom: 1px solid #000 !important; }
the padding comes ul
list may try using div before list. stretch 100%.
html
<div class="well sidebar-nav left"> <div class="divider"></div> <ul class="nav nav-list"> <li class="nav-header">sidebar</li> <li class="active"><a href="#">link</a></li> <li><a href="#">link</a></li> <li><a href="#">link</a></li> <li><a href="#">link</a></li> </ul> </div>
css
.divider { border-top: 1px solid #000 !important; border-bottom: 1px solid #000 !important; height: 1px; }
update
i think found better solution not need change in markup, can have li,divider
anywhere in list. add css:
.nav-list { padding: 0; } .nav-list > li > a, .nav-list .nav-header { margin: 0; }
Comments
Post a Comment