I have a horizontal nav bar made with purely CSS. Everything is working perfect except when i try to make the main <li> have a background-image hover the image does not show. Ive looked everywhere for this problem, and it seems my code is correct. What could i be missing? By the way Yes i am using a html5 doctype at the top of my editor.
<nav> <!--Top Header Nav Bar-->
<ul>
<li><a href="#">Explore</a>
<ul>
<li><a href="#">Fishing</a><hr /></li>
<li><a href="#">Pampering</a><hr /></li>
<li><a href="#">Weddings</a><hr /></li>
<li><a href="#">Water Sports</a><hr /></li>
<li><a href="#">Romantic Getaways</a><hr /></li>
<li><a href="#">Boating</a><hr /></li>
<li><a href="#">Cuisine</a><hr /></li>
<li><a href="#">Private Planes</a></li>
</ul>
</li>
<li><a href="#">Leisure</a></li>
<li><a href="#">Cruises</a>
<ul>
<li><a href="#">Royal Caribbean</a><hr /></li>
<li><a href="#">Carnival</a><hr /></li>
<li><a href="#">Disney Cruise</a><hr /></li>
<li><a href="#">Norwegian Cruise</a></li>
</ul>
</li>
<li><a href="#">Beaches</a>
<ul>
<li><a href="#">Abacos</a><hr /></li>
<li><a href="#">The Exumas</a><hr /></li>
<li><a href="#">Harbour Island</a><hr /></li>
<li><a href="#">Grand Bahama Island</a><hr /></li>
<li><a href="#">Long Island</a></li>
</ul>
</li>
<li><a href="#">Book A Trip</a></li>
</ul>
</nav>
/* Nav Bart Style */
nav ul ul {
display: none;
}
nav ul li:hover > ul {
display: block;
}
nav ul {
background: #0;
box-shadow: 0px 0px 9px rgba(0,0,0,0.15);
padding: 0 20px;
border-radius: 10px;
list-style: none;
position: relative;
display: inline-table;
}
nav ul:after {
content: ""; clear: both; display: block;
}
nav ul li {
float: left;
}
nav ul li:hover a{ /* Image Hover */
background-image:url(../images/hover.png) no-repeat;
}
nav ul li:hover a {
color: #0;
}
nav ul li a { /* Text Color - Top */
display: block; padding: 15px 30px;
color: #FFF; text-decoration: none;
}
nav ul ul { /* Drop Down BackGround Color */
background: rgb(0, 0, 0) transparent;
/* RGBa with 0.6 opacity */
background: rgba(0, 0, 0, 0.6);
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
/* For IE 8*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
border-radius: 0px;
padding: 0;
position: absolute;
top: 100%;
}
nav ul ul li {
float: none;
position: relative;
}
nav ul ul li a {
padding: 15px 40px;
color: #fff;
}
nav ul ul li a:hover {
background: #FF0;
opacity:0.4;
}
nav ul ul ul {
position: absolute; left: 100%; top:0;
}
hr {
border:none;border-top:1px solid #666; /*Divide Line For Top Nav*/
border-bottom:1px solid #ccc;
width:90%;
margin:0px auto 0px auto;
}