复制代码代码如下:
<span style = "font-size: 14px;"> <! Doctype html public "-// w3c // dtd xhtml 1.0 Transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transicional.dtd ">
<html xmlns = "http://www.w3.org/1999/xhtml">
<Evista>
<meta http-equiv = "content-type" content = "texthtml; charset = utf-8">
<title> menú </title>
<style type = "text/css">
#nav
{
Estilo de lista: Ninguno;
Text-Align: Center;
}
#nav li
{
flotante: izquierda;
Ancho: 100px;
Color: blanco;
Color de fondo: #3E3E3E;
}
#menú
{
Estilo de lista: Ninguno;
relleno: 5px;
Pantalla: ninguno;
margen -izquierda: -5px;
margen -top: -5px;
}
#menu li
{
Color de fondo: #CCC;
Ancho: 100px;
text-align: izquierda;
ROLDE-LEFT: 10px;
}
#Menu Li A: Link
{
Decoración de texto: ninguna;
Pantalla: bloque;
}
#Menu Li A: Hover
{
Color de fondo:#3E3E3E;
Color: blanco
}
</style>
</ablo>
<Body>
<ul id = "nav">
<li> 数 据 库
<ul id = "menú">
<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 = "menú">
<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 = "menú">
<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;
para (i = 0; i <lis.length; i ++)
{
if (lis [i] .classname == "niño")
{
lis [i] .onmouseover = function ()
{
var ulobj1 = this.getElementsByTagName ('ul') [0];
ulobj1.style.display = "bloque";
this.style.backgroundcolor = "#ccc";
this.style.color = "Black";
}
}
lis [i] .onmouseout = function ()
{
var ulobj1 = this.getElementsByTagName ('ul') [0]; // este 是 htmlelement 对象
ulobj1.style.display = "Ninguno";
this.style.backgroundcolor = "#3e3e3e";
this.style.color = "White";
}
}
</script>
</body>
</html> </span>