Hi!
I had a mouseover submenu working very nicely on my site (so nicely in fact that it was working exactly right in Chrome, IE 7 & 8, and FF), but now it's broken somehow and I can't see the problem.
Here's the CSS:
.MainMenu {
width: 90% !important;
min-width: 800px;
height: 42px !important;
padding: 0 0 0 10%;
overflow: hidden;
border-top: 1px solid #0054a6;
border-bottom: 1px solid #0054a6;
background: transparent url("Images/ServiceMenuBG.png");
background-repeat: repeat-x;
}
.MainMenu ul {
padding: 0;
margin:0;
list-style: none;
}
.MainMenu li {
float: left;
position: relative;
height: 31px;
width: 150px;
padding: 11px 0 0 0;
text-align: center;
border-right: 1px solid #0054a6;
}
.MainMenuItem#First { border-left: 1px solid #0054a6; }
.MainMenuItem a {
color: #ffffff;
display: block;
height: 31px;
width: 150px;
font-weight: bold;
text-decoration: none;
}
.MainMenuItem:hover { background: transparent url("Images/ServiceMenuBG.png") repeat-x 0 -42px; }
.SubMenu {
z-index: 500;
display: none;
width: 150px !important;
position: absolute;
top: 10px;
left: 0;
background-color: rgb(51,118,184);
}
.SubMenu li { padding: 0 0 2px 5px; height: 20px !important; width: 143px; }
.SubMenu li a {
height: 20px !important;
font-weight: normal;
color: #ffffff;
text-align: left;
text-decoration: none;
}
.SubMenu li a:hover { text-decoration: underline; }
.MainMenu li.MainMenuItem>ul { top: auto; left: auto; }
.MainMenu li.MainMenuItem:hover ul { display: block; }'
Here's the HTML:
<div class="MainMenu">
<ul>
<li class="MainMenuItem" id="First"><a href="~/Default.aspx">Home</a></li>
<li class="MainMenuItem"><a href="Pages/Philosophies.aspx">Philosophies</a></li>
<li class="MainMenuItem"><a href="Pages/Services.aspx#top">Services</a>
<ul class="SubMenu">
<li id="TopItem"><a href="Pages/Services.aspx#shop">Shop Repair</a></li>
<li><a href="Pages/Services.aspx#donations">Donations</a></li>
<li><a href="Pages/Services.aspx#consulting">Consulting</a></li>
<li id="BottomItem"><a href="Pages/Services.aspx#on-site">On-site Service</a></li>
</ul>
</li>
<li class="MainMenuItem"><a href="Pages/Contracts.aspx">Contracts</a></li>
<li class="MainMenuItem"><a href="Pages/AboutUs.aspx">About Us</a></li>
<li class="MainMenuItem"><a href="Pages/ContactUs.aspx">Contact Us</a></li>
</ul>
</div>
The SubMenu doesn't display either on mouseover or if I set it's initial display
property to block
. It's as if it doesn't exist on the page at all.
Thanks in advance for any help.