复制代码代码如下:
<span style = "font-size: 14px;"> <! doctype html public "- // w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<adal>
<méta http-equiv = "contenu-type" contenu = "texthtml; charset = utf-8">
<Title> Menu </Title>
<style type = "text / css">
#nav
{
Style de liste: aucun;
Texte-aligne: Centre;
}
#nav li
{
flottant: à gauche;
Largeur: 100px;
Couleur: blanc;
Color d'arrière-plan: # 3E3E3E;
}
#menu
{
Style de liste: aucun;
rembourrage: 5px;
Affichage: aucun;
marge-gauche: -5px;
marge: -5px;
}
#Menu Li
{
Color d'arrière-plan: #ccc;
Largeur: 100px;
Texte-aligne: gauche;
padding-gauche: 10px;
}
#menu li a: lien
{
Décoration du texte: aucune;
Affichage: bloc;
}
#Menu Li A: Rover
{
Color d'arrière-plan: # 3E3E3E;
Couleur: blanc
}
</ style>
</ head>
<body>
<ul id = "nav">
<li> 数 据 库
<ul id = "menu">
<li> <a href = "http://blog.csdn.net/u011043843"> mysql </a> </li>
<li> <a href = "http://blog.csdn.net/U011043843"> SQL Server </a> </li>
<li> <a href = "http://blog.csdn.net/U011043843"> Oracle </a> </li>
<li> <a href = "http://blog.csdn.net/U011043843"> db2 </a> </li>
</ul>
</li>
<li> 前台脚本
<ul id = "menu">
<li> <a href = "http://blog.csdn.net/u011043843"> javascript </a> </li>
<li> <a href = "http://blog.csdn.net/U011043843"> Ruby </a> </li>
<li> <a href = "http://blog.csdn.net/u011043843"> html </a> </li>
<li> <a href = "http://blog.csdn.net/U011043843"> Python </a> </li>
</ul>
</li>
<li> 后台脚本
<ul id = "menu">
<li> <a href = "http://blog.csdn.net/u011043843"> php </a> </li>
<li> <a href = "http://blog.csdn.net/u011043843"> asp </a> </li>
<li> <a href = "http://blog.csdn.net/U011043843"> asp.net </a> </li>
<li> <a href = "http://blog.csdn.net/u011043843"> jsp </a> </li>
</ul>
</li>
</ul>
<script type = "text / javascript">
var lis = document.getElementById ("nav"). getElementsByTagName ('li');
var i = 0;
pour (i = 0; i <lis.length; i ++)
{
if (lis [i] .classname == "enfant")
{
lis [i] .onMouseOver = function ()
{
var uloBj1 = this.getElementsByTagName ('ul') [0];
ulobj1.style.display = "bloc";
this.style.backgroundcolor = "# ccc";
this.style.color = "noir";
}
}
lis [i] .onMouseout = function ()
{
var uloBj1 = this.getElementsByTagName ('ul') [0]; // ce 是 htmlelement 对象
ulobj1.style.display = "Aucun";
this.style.backgroundcolor = "# 3e3e3e";
this.style.color = "blanc";
}
}
</cript>
</docy>
</html> </span>