i have written a css code for my drop down menu
PROBLEMS WITH MY DROP DOWN MENU ARE ::
- when i hover on my main menu item(i.e. in the exapmle 2nd one "bbbbb") it displays the submenu...thats ok..but its appearing with in the main menu by increaing its height
- the background of main menu becomes the background of sub menu too,obviously i dont want that
- in main menu list items starts with lot of text-inedent,i dont want that
- text are aligned right in submenu
- i want content width for sub menu not more than that
MY HTML ::
<div class="menu">
<ul>
<li><a href="#">aaaaaaaaaa</a></li>
<li><a href="#">bbbbbbbbbb</a>
<ul>
<li><a href="#">aaaaaaaaaa</a></li>
<li><a href="#">bbbbbbbbbb</a></li>
</ul>
</li>
</ul>
</div>
my css::
.menu{
width:70%;
overflow:hidden;
background:green;
position:relative;
}
.menu ul{list-style:none;}
.menu ul li{ margin-left:20px;position:relative; float:left}
.menu ul ul{display:none;}
.menu ul li:hover ul{display:block; background:black;}
.menu ul li:hover ul li{ float:none;}
and please explain my mistake