I am new to HTML and CSS and am currently having 2 problems with an icon that is displayed when the mouse hovers over a menu item.
Problem 1
I want the icon to appear to the left of the menu item, but can only get it to display on top of the first letter if the menu item (not say 5px to the left of).
Problem 2
When the mouse hovers over one of the submenu items the icon appears for both the submenu item and its parent - I only want it to display for the submenu item.
Code extracts below. Any help much appreciated.
HTML
<div id="menu">
<ul>
<li id="menu_1">
<a href="Aboutus.html">About Us
<ul id="about_sub">
<li><a href="Who.html">Who We Are</a></li>
<li><a href="What.html">What We Do</a></li>
</ul>
</a>
</li>
<li id="menu_2">
<a href="Services.html">Services
<ul id="services_sub">
<li><a href="Service1.html">Service 1</a></li>
<li><a href="Service2.html">Service 2</a></li>
<li><a href="Service2.html">Service 3</a></li>
</ul>
</a>
</li>
<li id="menu_3">
<a href="Contact.html">Contact Us</a>
</li>
</ul>
</div>
CSS
#menu ul {
position: absolute;
list-style: none;
top:150px;
left: 25px;
width: 120px;
padding: 0px;
margin: 0px;
text-align: left;
font-size: 12px;
font-weight: bold;
}
#menu li {
margin-top: 5px;
}
#menu ul li:hover {
background: url(Images/Menu.bmp) no-repeat;
}
#menu li ul {
position: relative;
top: 0px;
left: 5px;
margin-top: 0px;
font-size: 11px;
font-weight: bold;
}