I am working with http://www.glustik.com/dustreeproductions/index.php
The Entertainment link has a drop down menu, and I am trying to make it so that the drop down hovers still keep the Entertainment parent link to be in its hover state. (Does that make sense?) Also, this will be a double drop down in the near future.
My CSS :
#nav ul li:hover ul#sub li a {
display:block;
background:#e6e6e6;
color:#CC0066;
padding:5px 15px 0px 25px;
height:25px;
width:290px;
text-align: left;
border-bottom: 1px solid #f2f2f2;
border-right: none;
margin: 0 0;
}
HTML :
<div id="nav-box">
<div id="main-nav">
<div id="nav">
<ul>
<li id="company"><a title="Company" href="http://www.glustik.com/dustreeproductions/company.php"></a></li>
<li id="entertainment"><a title="Entertainment" href="http://www.glustik.com/dustreeproductions/entertainment.php"></a>
<ul id="sub">
<li id="dance"> <a href="http://www.jasontanzer.com/guitarist-original-music.asp">Dance</a></li>
<ul id="subDance">
<li id="smiths"> <a href="http://www.jasontanzer.com/guitarist-original-music.asp">Smiths</a></li>
</ul>
<li id="classicRock"><a href="http://www.jasontanzer.com/guitarist-shows-covers.asp">Classic Rock | Top 40 | Rock</a></li>
<li id="country"><a href="http://www.jasontanzer.com/commercial-tv-film-jingles.asp">Country</a></li>
<li id="rockabilly"><a href="http://www.jasontanzer.com/composer.asp">Rockabilly | Reggae | Bluegrass | Other</a></li>
<li id="karaoke"><a href="http://www.jasontanzer.com/composer.asp">Karaoke | Live Band Karaoke | All Requests</a></li>
<li id="solos"><a href="http://www.jasontanzer.com/composer.asp">Solo's | Duo's | Trio's</a></li>
<li id="productionShows"><a href="http://www.jasontanzer.com/composer.asp">Production Shows</a></li>
<li id="dj"><a href="http://www.jasontanzer.com/composer.asp">DJ's</a></li>
</ul>
</li>
<li id="video"><a href="http://www.glustik.com/dustreeproductions/video.php"></a>
</li>
<li id="studio"><a href="http://www.glustik.com/dustreeproductions/studio.php"></a>
</li>
<li id="liveAudio"><a href="http://www.glustik.com/dustreeproductions/live-audio.php"></a>
</li>
<li id="eventPlanning"><a href="http://www.glustik.com/dustreeproductions/event-planning.php"></a>
</li>
<li id="contact"><a href="http://www.glustik.com/dustreeproductions/contact.php"></a>
</li>
</ul>
</div> <!-- end Nav -->
</div> <!-- end Main Nav -->
</div> <!-- end Nav Box -->
#nav ul li:hover ul#sub li a:hover {
background:#CCC;
color:#CC0066;
}
Change the selector here:
into this:
That means: whenever the element with an
idofentertainment(that’s inside an element with theidofnav) is hovered over, select anyaelements that are direct children.You’ll have to make the “same change” for each of your other buttons.
It’s not optimal to use
#nav #entertainment ..– it’s an “overly qualified selector” (twoids).#entertainment ..is sufficient.See: http://code.google.com/speed/page-speed/docs/rendering.html#UseEfficientCSSSelectors
It doesn’t make any practical difference – but, it is a best practise that you should try to adhere to.