Hello
. In short, you were placing the dropdown too faraway.
Update your entire CSS file with this
Code:
* { margin: 0; padding: 0; }
body { font-family: arial, serif; background: #bababa; font-size:10px;}
article, aside, figure, footer, header, nav, section { display: block; }
li {list-style: none;
float:left;}
img,fieldset {
border:none;
}
/*Main Navigation Bar--------------------------*/
.nav_main{
clear:both;
background:#3c93df;
border-top: 1px solid #3b3b3b;
border-bottom:1px solid #3b3b3b;
font-size:1.5em;
line-height:1.4em;
font-family:arial;
color: white;
text-transform:uppercase;
}
.nav_main ul {
padding-top:4px;
float:left;
margin-left:40px;
}
.nav_main li {
padding-right: 2em;
position:relative;
}
/*Menu Div ID wrap within nav*/
#mainMenu {
clear:both;
zoom:1;
text-align:left;
text-transform:uppercase;
}
#mainMenu a {
color:#DEF;
text-shadow:0 0 2px #004;
text-decoration:none;
}
#mainMenu a:active,
#mainMenu a:focus,
#mainMenu a:hover {
color:#FFF;
text-shadow:0 0 4px #04C;
}
.nav_main ul ul.sub-menu {
left: 0pt;
padding:0;
position: absolute;
top:100%;
margin-left:-999em;
}
.nav_main ul li {
position: relative;
padding-bottom:6px;
}
.ul.sub-menu {
padding-top: 15px;
}
.nav_main ul li li {
background: none repeat scroll 0% 0% #3c93df;
border-top: 1px solid #FFFFFF;
color: #FFFFFF;
margin-left: 0px;
margin-top: 0px;
padding: 5px 10px;
position: static;
white-space: nowrap;
width:100%;
}
.nav_main ul li:hover ul.sub-menu {
background: none repeat scroll 0% 0% transparent;
font-size: 0.8em;
padding-top:0px;
margin: 0px 0pt 0pt -9px;
}
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
And now update your HTML..
<nav class="nav_main clearfix">
You should know that <nav>, being HTML5, isn't supported at all in IE8 and down, so your page is essentially busted completely in those browsers. I switched it to <div> instead in my local file.
Some things noteworthy: You were using display:none to hide/show the dropdown. Don't do that
. In my example I used a negative left margin to hide, and then set to 0 to show (you already defined margin-left:0; on the hover code anyway so it worked otu perfectly). Also, I changed the coordinates set for the AP dropdown to %'s instead of pt, and I removed the height of the <nav> container, allowing the content to dictate the height. Thus the clearfix code at the bottom of the CSS file is needed to contain floated elements
Bookmarks