Ok I have a drop down menu that functions with some jquery but now I am trying to get it working with css in case users have js disabled. I have a selector with the hover pseudo-class and I am telling it to display:block the hidden submenu when moused over. But when I try to select any links in the sub-menu it promptly disappears once my cursor moves off the element I am assigning to the pseudo-class. sorry if my terminology is off I am new to this. Here is the pertinent code:
<nav>
<ul id="ddmenu">
<li><a href="index.html">Homepage</a></li>
<li><a href="#">About</a>
<ul>
<li><a href="#">Our Mission</a></li>
<li><a href="#">The Staff</a></li>
<li><a href="#">History</a></li>
</ul>
</li>
<li><a href="#">Services</a>
<ul>
<li><a href="#">Donations</a></li>
<li><a href="#">Volunteering</a></li>
<li><a href="#">Housing</a></li>
</ul>
</li>
<li><a href="#">International</a>
<ul>
<li><a href="#">China</a></li>
<li><a href="#">Japan</a></li>
<li><a href="#">Canada</a></li>
<li><a href="#">Australia</a></li>
<li><a href="#">South America</a></li>
</ul>
</li>
<li><a href="contact.php">Contact Us</a></li>
</ul>
</nav>
and here is my css:
#ddmenu li { display: block; position: relative; float: left; font-size: 1.45em; text-shadow: 1px 1px 0 #fff; border-right: 1px solid #dae0e5; }
#ddmenu li a {
display: block;
float: left;
padding: 0 12px;
line-height: 78px;
font-weight: bold;
text-decoration: none;
color: #FF0000;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
transition: all 0.2s linear;
}
#ddmenu li:hover > a { color: #565051; background: #C0C0C0; }
#ddmenu li:hover ul { display: block;}
#ddmenu ul {
position: absolute;
top: 88px;
width: 130px;
background: #fff;
display: none;
margin: 0;
padding: 7px 0;
list-style: none;
border-radius: 3px;
border: 1px solid rgba(0, 0, 0, 0.2);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
/* tooltip arrow */
#ddmenu ul:after {
content: "";
width: 0;
height: 0;
position: absolute;
bottom: 100%;
left: 8px;
border-width: 0 8px 8px 8px;
border-style: solid;
border-color: #fff transparent;
}
#ddmenu ul:before {
content: "";
width: 0;
height: 0;
position: absolute;
bottom: 100%;
left: 4px;
border-width: 0 10px 10px 10px;
border-style: solid;
border-color: rgba(0, 0, 0, 0.1) transparent;
}
#ddmenu ul li {
display: block;
width: 100%;
font-size: 0.9em;
text-shadow: 1px 1px 0 #fff;
}
#ddmenu ul li a {
display: block;
width: 100%;
padding: 6px 7px;
line-height: 1.4em;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
transition: all 0.2s linear;
}
#ddmenu ul li a:hover { background: #C0C0C0; }
thanks for your time guys