I've configured my Bootstrap navigation with a dropdown toggle for "Coverage". I'm looking to decrease the spacing between each list item (li) under this dropdown. What CSS setting should I use to achieve this? Interestingly, when I apply float: left to ul li a, the space reduces, but I don't want to rely on float for this adjustment. Can you explain why float reduces the spacing?
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand mycontent5" href="/?goHome=true"><span class="glyphicon glyphicon-home"></span></a>
<button type="button" data-toggle="collapse" data-target=".navbar-collapse" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse navbar-left">
<ul class="nav navbar-nav">
<li><a href="/Analyst">Analysts</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Coverage<span class="caret"></span></a>
<ul class="dropdown-menu" id="mynavlist">
<li><a href="/Coverage/Coverage?status=A">All Coverage</a></li>
<li><a href="/Coverage/CoverageAssignments?groupingBySector=True">Coverage Assignments</a></li>
<li><a href="/Holding/PortfolioCoverage">Portfolio Coverage</a></li>
<li><a href="/Holding/PortfolioSnapshot">Portfolio Snapshot</a></li>
<li><a href="/Writeup/WriteupSections?status=A">Writeup Sections</a></li>
</ul>
</li>
<li><a href="/Holding/List">Funds</a></li>
<li><a href="/Blotter/Account?analystname=Scott%20Mabry">Intraday Orders</a></li>
<li><a href="#" class="dropdown-toggle">Reports</a></li>
</ul>
</div>
</nav>
UPDATE: I have assigned an ID of "mynavlist" to my ul and applied the following CSS:
#mynavlist li a {
padding-top: 0px !important;
padding-bottom: 0px !important;
margin-top: 0px !important;
margin-bottom: 0px !important;
}
As shown in the screenshot below, I am trying to eliminate all excess white space above and below each item. Adjusting the pixel sizes affects the list as expected, but how can I completely remove the extra space?