Reputation: 109
I have created a vertical navbar that contains an ul element with several li tags inside. I want each li tag to display on it's own line.
I'm able to do this easily by applying a div class = clearfix after each li tag, but I get a warning that 's are not allowed to be nested inside an ul. It renders just fine in browser, but I don't like the warnings and I'm OCD about syntax.
I have tried several different approaches to fix the problem.
CSS Fixes such as Margin/Padding, Clear, Display:Block all to no avail.
Here is my a sample of my code below:
<div class="col-sm-2" id="siteSafetyContainer" style="display:none">
<nav class="navbar navbar-inverse" style="font-size:12px;">
<div id="row">
<ul class="nav navbar-nav navbarcustom">
<li>
<a href="#">Permits</a>
</li>
<li>
<a href="#" onclick="">Standard Safety Permits</a>
</li>
<li>
<a href="#" onclick="">Toolbox Talks</a>
</li>
<li>
<a href="#" onclick="">Atlantic Marine Corps Communities</a>
</li>
<li>
<a href="#" onclick="">Campbell Crossing</a>
</li>
<li>
<a href="#" onclick="">Fort Hood Family Housing</a>
</li>
<li>
<a href="#" onclick="">Ft Drum Mountain Community</a>
</li>
<li>
<a href="#" onclick="">PAL</a>
</li>
</ul>
</div>
</nav>
</div>
Standard Safety Permits
Toolbox Talks
Atlantic Marine Corps Communities
Campbell Crossing
Fort Hood Family Housing
Ft Drum Mountain Community
PAL
Upvotes: 0
Views: 272
Reputation: 109
McHat and cpt-cruncy,
Thanks to both of you! It was a combination of both of your answers. See below:
.navbarcustom > li {
flex-flow: column wrap !important;
min-width: 260px;}
Upvotes: 0
Reputation: 391
Try this
.navbar-nav{
flex-flow: column wrap !important;
min-width: 260px;
}
Upvotes: 1