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>
这是因为您将LI高度限制为20像素,只需从CSS中删除该行即可正常工作。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.