<!DOCTYPE?html>
<html?lang="en">
<head>
????<meta?charset="UTF-8">
????<title>下拉菜單</title>
????<style?type="text/css">
?*{padding:0;margin:0}
????????#nav{
????????????background-color:#eee;
?width:600px;
?height:40px;
?margin:0?auto;
?}
????????ul{
????????????list-style:?none;
?}
????????ul?li{
????????????float:left;
?line-height:40px;
?text-align:center;
?position:relative;
?}
????????a{
????????????text-decoration:none;
?color:#000;
?padding:0?10px;
?display:block;
?}
????????a:hover{
????????????color:#fff;
?background-color:#666;
?}
????????ul?li?ul?li{
????????????float:none;
?background-color:#eee;
?margin-top:2px;}
????????ul?li?ul{
????????????position:absolute;
?left:0;
?top:40px;}
????</style>
</head>
<body>
??<div?id="nav">
?????<ul>
?????????<li><a?href="#">首頁</a></li>
?????????<li><a?href="#">課程大廳</a></li>
????????????<ul>
????????????????<li><a?href="#">javascript</a></li>
????????????????<li><a?href="#">jquery</a></li>
????????????</ul>
?????????<li><a?href="#">學習中心</a></li>
?????????<li><a?href="#">經典案例</a></li>
?????????<li><a?href="#">關于我們</a></li>
?????</ul>
??</div>
</body>
</html>

2020-07-15
應該將二級菜單放在一級菜單中,<li>二級菜單放在這里</li>
<li><a href="#">課程大廳</a>
? ? ? ? ? ? <ul>
? ? ? ? ? ? ? ? <li><a href="#">javascript</a></li>
? ? ? ? ? ? ? ? <li><a href="#">jquery</a></li>
? ? ? ? ? ? </ul>
? ? ? ? </li>
2018-08-05
只有第一個ul下的里的li浮動??