I have been working on figuring out how to make a double drop down menu.
Live Page I am working with : http://www.glustik.com/dustreeproductions/
The “Entertainment” button, will be the only one with a Drop Down.
I have set up the parent selection, but each one will have a small list of bands when hovered over.
Example: “Dance” will have about 7 bands (Band #1 – Band#7)
The secondary drop down should appear to the right of the parent drop down menu.
Any help would be greatly appreciated. I have been struggling with this for some time.
My Relavant HTML (nav) Markup :
<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>
<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>
. . . . . and so on.
My CSS (nav) Markup :
#nav #company a {
background:url(../images/navigation/nav-company.png) no-repeat;
display:block;
text-decoration:none;
width:103px;
margin:20px 27px 0 20px;
height:20px;}
#nav #company:hover > a {
background-position:0 -20px;}
#nav #company a:active {
background-position:0 -40px;}
body#body_company #company a {
background-position:0 -40px;}
#nav #entertainment a {
background:url(../images/navigation/nav-entertainment.png) no-repeat;
display:block;
text-decoration:none;
width:168px;
margin:20px 27px 0 0;
height:20px;}
#nav #entertainment:hover > a {
background-position:0 -20px;}
#nav #entertainment a:active {
background-position:0 -40px;}
body#body_entertainment #entertainment a {
background-position:0 -40px;}
. . . . . and so on.
Since your CSS already contains the child combinator selector, I am assuming you don’t care for browsers that don’t support it (like IE6).
It can be done with just CSS. I added the text to the
<a>elements for display purposes and added Band #1 – Band#7 to Dance and a Band #1 to the next item just to show the alignment with the top of the music genre.Hope this helps 🙂