Reputation: 127
The background color in my navigation bar isn't filling the entire cell. Their is a line at the bottom of the menu that remains the color of the background of the page itself. How do i fill entire cell with background color correctly?
Here is a JSFiddle i made to test it out. I'm new to JSFiddle so im not sure how long the link stays active.
CSS
.hovermenu ul {
font: bold 20px Tahoma;
padding-left: 0;
padding: 0;
margin-left: 0;
height: 20px;
display:inline-block;
background-color:red;
}
.hovermenu ul li {
display: block;
position: relative;
float: left;
margin: 0;
}
.hovermenu li ul { display: none; }
.hovermenu ul li a {
display: block;
text-decoration: none;
color: black;
border: 2px solid #000000;
padding: 2px 0.5em;
}
.hovermenu ul li a:hover
{
background-color:#fdff30;
border-style: outset;
}
.hovermenu li:hover ul {
display: block;
position: absolute;
}
.hovermenu li:hover li {
float: none;
font-size: 20px;
}
.hovermenu li:hover a { background: #EEEEEE; }
.hovermenu li:hover li a:hover { background: #fdff30; }
html>body .hovermenu ul li a:active{ /* Apply mousedown effect only to NON IE browsers */
border-style: inset;
}
HTML
<div class="hovermenu">
<ul>
<li><a href="/index.html">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="/inventory.html">Inventory</a>
<ul>
<li><a href="/Trucks/main.html">Trucks</a></li>
<li><a href="location.html">Equipment</a></li>
<li><a href="location.html">Trailers</a></li>
</ul>
</li>
<li><a href="location.html">Location</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</div>
Upvotes: 0
Views: 1291
Reputation: 627
It is due to you are limiting the LI height with 20px, just remove that line from your css and it will work fine.
Upvotes: 1