下拉菜单,其实就是使用HTML+css和一些小小的js就能很简单的实现,
首先需要你有至少有2个div然后在将第一个div作为父级元素,然后在使用position:absolut;绝对定位一下;
然后在使用JS,获取对象,然后添加一个鼠标的onmouseover事件就行了
在这里给你看下我以前的写的一个代码
body,html{padding:0;margin:0;text-align:center;font:normal 14px 'arial';}
#mainNavBar{width:100%;background:#999;padding:10px 0;}
#nav{width:760px;height:30px;margin:0 auto;}
#nav ul{padding:0;margin:0;}
#nav ul li{position:relative;float:left;width:60px;height:30px;line-height:30px;overflow:hidden;list-style-type:none;}
#nav ul li a{display:block;color:#fff;text-decoration:none;}
#nav ul li a:hover{font-weight:bold;background:#666;}
#subNav{position:absolute;width:150px;top:30px;left:0px;padding:5px;background:#666;color:#fff;text-align:left;}
#subNav a{text-decoration:none;font-weight:normal;display:block;}
#subNav a:hover{color:#f00;background:#f00;}
var nav=document.getElementById("nav").getElementsByTagName("li");
for(i=0;i nav[i].onmouseover=function(){ this.style.fontWeight="bold"; this.style.overflow="visible"; this.style.background="#666666"; } nav[i].onmouseout=function(){ this.style.fontWeight="normal"; this.style.background="#999999" this.style.overflow="hidden"; } } #header #shousuo{ width:950px; height:50px; background:#f4f4f4; margin-top:10px; } #shousuo ul li{ line-height:50px; list-style-type:none; float:left; margin-left:5px; font-weight:bold; font-size:14px; }
一般做下拉菜单可以用fireworks做,里边有很好的做下拉菜单的专门功能。
select标签啊