我正在尝试制作带有水平子菜单的水平菜单。我尝试了一些方法,但没有成功:上面的代码应该显示水平主菜单,当您将鼠标悬停在其中一个链接上时,链接的颜色会发生变化并出现水平子菜单。
html代码:
<div id="menu">
<ul>
<li style="float: left; a:hover; "><a href="acceuil.html" style="color : #CBCAC7 ;">ACCEUIL</a> <img src="decoupage/puce_menu.png" height="15"/>
<ul>
<li style="float: left; display: none; "><a href="#">Présentation</a> </li>
</ul>
</li>
<li style="float: left; "><a href="methodologie.html" style="color : #CBCAC7 ;" >METHODOLOGIE</a></li> <img src="decoupage/puce_menu.png" height="15"/>
<li style="float: left; "><a href="references.html" style="color : #CBCAC7 ;">REFERENCES</a> <img src="decoupage/puce_menu.png" height="15"/>
<ul>
<li style="float: left; display: none; "><a href="#">Urbanisme</a></li>
<li style="float: left; display: none; "><a href="#">Tours</a></li>
<li style="float: left; display: none; "><a href="#">Bureau</a></li>
<li style="float: left; display: none; "><a href="#">Commerce</a></li>
<li style="float: left; display: none; "><a href="#">Logements</a></li>
</ul>
</li>
<li style="float: left; "><a href="partenaires.html" style="color : #CBCAC7 ;">PARTENAIRES</a></li> <img src="decoupage/puce_menu.png" height="15"/>
<li style="float: left; "><a href="contact.html" style="color : #CBCAC7 ;">CONTACT</a></li> <img src="decoupage/puce_menu.png" height="15"/>
</ul>
</div>
CSS 代码
#menu
{ position: absolute;
right: 550px;
bottom: 460px;
z-index: 2;
font-style: italic ;
font-size: large ;
}
#menu li.hover ul {
display: inline;}