//www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">&
lthead><meta http-equiv="Content-
Type" content="text/htmlcharset=utf-8" /><title>下拉列表<
/title><style type="text/css">
body,div,a{ margin:0padding:0}#demo{ margin:0 autowidth:500px}#demo a{color:#000text-
decoration:nonedisplay:blockwidth:200pxheight:20pxline-
height:18pxborder:1px solid #009text-
indent:1em}#demo a:hover{ color:#F30text-
decoration:underlinebackground:#CCC}#demo1 a{ width:200pxheight:autoborder:1px solid #009border-
top:nonetext-
indent:1embackground:#CCCwidth:200pxdisplay:block}#demo1 a:hover{ color:#F30background:#FFF}#demo1{ margin:0 autowidth:500pxheight:autodisplay:none}</style><script type="text
/javascript">window.onload=function()
{var oA1=document.getElementById("demo1") var oA=document.getElementById("demo") oA.onclick=function(){var style=oA1.style if(style.display==""||style.display=="none"){style.display="block" }else{style.display="none" }}}&
lt/script></head><body> <div id="demo"&
gt <a href="javascript:" title="中国">中国</a> <
/div> <div id="demo1"> <
a href="javascript:" title="广东">广东</a> <
a href="javascript:" title="广东">广东</a> <
a href="javascript:" title="广东">广东</a> <
a href="javascript:" title="广东">广东</a> <
a href="javascript:" title="广东">广东</a> </div><
/body></html>
用div+css的ul、li结合script脚本实现下拉列表菜单,全部代码如下,复制在DW中预览即可看到效果,细节样式可以自行修改:<!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">
<head>
<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />
<title>DIV+CSS实现下拉列表菜单</title>
<style type="text/css">
<!--
ul {
margin: 0px
padding: 0px
list-style-type: none
}
li{
float:left
width:160px
margin-left:1px
}
ul li a{
display:block
font-size:12px
border:#CCCCCC 1px solid
padding:3px
text-decoration:none
color:#777777
margin-top:1px
text-align:center
}
ul li a:hover{
background-color:#0099CC
color:#FFFFFF
}
li ul{
display:none
top:20px
margin-top:1px
}
li:hover ul,li.over ul{
display:block
}
-->
</style>
</head>
<script type="text/javascript"><!--//--><![cdata]//><!--
startlist = function() {
if (document.all&&document.getElementByIdx) {
navRoot = document.getElementByIdx("nav")
for (i=0i<navRoot.childNodes.lengthi++) {
node = navRoot.childNodes[i]
if (node.nodeName=="li") {
node.onmouseover=function() {
this.className+=" over"
}
node.onmouseout=function() {
this.className=this.className.replace(" over","")
}
}
}
}
}
window.onload=startlist
//--><!]]></script>
</script>
<body>
<ul >
<li><a href="">文章</a>
<ul>
<li><a href="">CSS 教程</a></li>
<li><a href="">DOM 教程</a></li>
<li><a href="">XML 教程</a></li>
<li><a href="">Flash 教程</a></li>
</ul>
</li>
<li><a href="">参考</a>
<ul>
<li><a href="">XHTML</a></li>
<li><a href="">XML</a></li>
<li><a href="">CSS</a></li>
</ul>
</li>
<li><a href="">Blog</a>
<ul>
<li><a href="">全部</a></li>
<li><a href="">网页技术</a></li>
<li><a href="">UI 技术</a></li>
<li><a href="">Flash 技术</a></li>
</ul>
</li>
<li><a href="">摇滚</a>
<ul>
<li><a href="">纯音乐</a></li>
<li><a href="">古典金曲</a></li>
<li><a href="">UI 技术</a></li>
<li><a href="">Flash 技术</a></li>
</ul>
</li>
</ul>
</body>
</html>
�0�2�0�2�0�2�0�2�0�2�0�2�0�2 select下拉列表框样式控制的关键就是在其外面嵌套一个div,并控制div边框格式以及其overflow属性,并请注意div和select各自的position属性,这个也很重要哈,大家可反复设置这几个属性的不同取值,做做实验,就明白其中道理了