Hi everyone,
I have a css-driven drop down menu that works for 1 level of drop downs. I’ve added a second level but I need help with adjusting the css so that it will be positioned over to the right. I’m trying to position the ul list which is nested within the li with an id of “level 2” as displayed in the following code block:
<li id="level2" ><a href="/massage">Massage</a>
<ul>
<li ><a href="/massage/sports">Sports</a></li>
<li ><a href="/massage/aromatherapy">Aromatherapy</a></li>
</ul>
</li>
The full html and css is shown below. I wondered if anyone could help me revise the code to get this working?
Really appreciate any help.
<nav> <a href="#" id="menu-toggle">Navigation</a>
<div id="window">
<ul>
<li ><a href="/">Home</a></li>
<li ><a href="/about">About</a>
<ul>
<li ><a href="/about/staff">Practitioners</a></li>
</ul>
</li>
<li ><a href="/features">Features</a>
<ul>
<li ><a href="/store">Store</a></li>
<li ><a href="/blog">Blog</a></li>
<li ><a href="/features/faqs">FAQs</a></li>
<li ><a href="/features/events">Events</a></li>
<li ><a href="/features/photo-gallery">Photo Gallery</a></li>
<li ><a href="/features/media-downloads">Media Downloads</a></li>
<li ><a href="/features/news">News</a></li>
</ul>
</li>
<li ><a href="#">Modalities</a>
<ul>
<li ><a href="/naturopathy">Naturopathy</a></li>
<li id="level2" ><a href="/massage">Massage</a>
<ul>
<li ><a href="/massage/sports">Sports</a></li>
<li ><a href="/massage/aromatherapy">Aromatherapy</a></li>
</ul>
</li>
<li ><a href="/reiki">Reiki</a></li>
<li ><a href="/iridology">Iridology</a></li>
<li ><a href="/herbal-medicine">Herbal Medicine</a></li>
<li ><a href="/nutritional-medicine">Nutritional Medicine</a></li>
</ul>
</li>
<li ><a href="http://www.miessence.com/shop/en/">Buy Organic Goods</a></li>
<li ><a href="/contact">Contact</a>
<ul>
<li ><a href="/booking-form">Make a booking</a></li>
</ul>
</li>
</ul>
</div>
</nav>
/* ========
Navigation
======================= */
nav{
clear: right;
float: right;
margin: 25px 0 0;
}
nav ul{
margin: 0;
overflow: hidden;
padding: 0;
}
nav ul > li{
display: inline;
float: left;
margin: 0;
padding: 0 10px;
}
nav ul li:last-child,
nav ul li:last-child a{
padding-right: 0;
}
nav ul a:link,
nav ul a:visited{
color: #3f5666;
display: block;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 0.9em;
font-weight: 400;
padding: 5px;
}
nav ul li:hover > a,
nav ul a:active,
nav ul a:hover,
nav ul li.selected a{
color: #758a99;
}
#menu-toggle {
background-color: rgb(210, 85, 66);
border-color: #ec7c64;
color: #FFF;
display: none;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 600;
font-size: 17px;
padding: 15px;
text-transform: uppercase;
width: 100%;
-webkit-border-radius: 5px;
border-radius: 5px;
}
/* ========
Sub Navigation
======================= */
nav ul li ul {
box-shadow: 0 2px 3px rgba(0,0,0,0.2);
left: -9999em;
margin: 0;
min-width: 165px;
position: absolute;
width: auto;
z-index: 333;
}
nav ul li:hover ul {
left: auto;
}
nav ul li ul li {
display: block;
float: none;
line-height: 36px;
margin: 0;
padding: 0;
}
nav ul li ul li a:link,
nav ul li ul li a:visited {
background: rgb(251,247,238);
border-bottom: 1px solid #aba79c;
border-top: 1px solid rgb(251,247,238);
color: #555;
display: block;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 600;
font-size: 12px;
padding: 5px 20px;
text-decoration: none;
}
nav ul li ul li a:active,
nav ul li ul li a:hover,
nav ul li ul li.selected a {
background: rgb(233,227,215);
color: #333;
}
nav ul ul li:hover a:after{
content:"»";
float: right;
}
/* ========
Side Navigation
======================= */
aside ul{
padding: 0;
margin-left: 0;
}
aside li{
list-style: none;
margin: 0;
padding: 0;
}
aside li a:link,
aside li a:visited{
border-top: 1px solid #eaeaea;
color: #444;
display: block;
padding: 5px;
}
aside li a:active,
aside li a:hover,
aside li.selected a{
background: rgb(210, 85, 66);
color: #fff;
}
aside li:first-child a{
border: none;
font-size: 1.25em;
font-weight: bold;
}
aside li:first-child a:hover,
aside li.selected:first-child a{
background: none;
color: #666;
}