網頁設計製作教學分享 css menu 橫式下拉橫式子選單(一)
我們在網頁設計或製作的同時,通常對於選單的顏色配置,也會使用較單一的顏色,這一個css menu 橫式下拉式選單的顏色配置就比較協調,是屬於較精緻型的配色。css選單有用圖下去配置的有用圖下去做的只要找到圖的位置,就可以更換。我們一看圓形角的就是圖了。這種css menu 選單通常在網頁設計或製作是時常會被用到的。
以下貼於<head>與</head>之間:
<style type="text/css">
#info {height:400px;}
#nav {margin:20px 0 80px 0;}
/* the styling */
#nav {float:left; width:750px; height:auto; background:#fff url("dropline/bottom_line.gif") repeat-x bottom; position:relative;}
#nav .select, #nav .current {margin:0; padding:0; list-style:none; display:block;}
#nav li {display:inline; margin:0; padding:0;height:auto;}
#nav .select a,
#nav .current a {display:block; height:21px; float:left; background: url("dropline/left_blue.gif") no-repeat left top; padding:0 0 0 3px; border-bottom:1px solid #000; text-decoration:none; font-size:10px; line-height:20px; white-space:nowrap; margin-left:2px;}
* html #nav .select a, * html #nav .current a {width:1px;}
#nav .select a b,
#nav .current a b {height:100%; display:block; background:url("dropline/right_blue.gif") no-repeat right top; padding:0 6px 0 3px; color:#000;}
#nav .select a:hover,
#nav .select li:hover a {background-position:0 -75px; border-color:#046; cursor:pointer;}
#nav .select a:hover b,
#nav .select li:hover a b {background-position:100% -75px; border-color:#046; color:#fff;}
#nav .sub {display:none;}
/* for IE5.5 and IE6 only */
#nav table {position:absolute; border-collapse:collapse; left:0; top:0; font-size:11px;}
#nav .current a {background-position:0 -75px; border-color:#046;}
#nav .current a b {background-position:100% -75px; color:#ff6;}
#nav .sub li a:hover,
#nav .select a:hover .sub li a:hover,
#nav .select li:hover .sub li a:hover {background:#005984 url(dropline/sub_sep.gif) top right no-repeat; color:#fff; text-decoration:underline;}
#nav .sub_active .current_sub a,
#nav .sub_active a:hover {background:#005984 url(dropline/sub_sep.gif) top right no-repeat; color:#ff6; text-decoration:underline;}
#nav .select li a:hover .sub,
#nav .select li:hover .sub {display:block; position:absolute; width:750px; top:21px; left:0; background:#005984; margin-top:1px; padding:0; z-index:100; border-bottom:20px solid #fff;}
#nav .sub, #nav .sub_active {margin:0; padding:0; list-style:none;}
#nav .sub_active {display:block; position:absolute; width:750px; top:21px; left:0; background:#005984; margin-top:1px; padding:0; z-index:10; color:#000; border-bottom:20px solid #fff;}
* html #nav .sub_active, * html #nav .select a:hover .sub {z-index:-1; margin-top:0; margin-t\op:1px;}
#nav .sub_active a {height:25px; float:left; text-decoration:none; line-height:24px; white-space:nowrap; font-weight:normal;}
#nav .sub_active a,
#nav .select a:hover .sub li a,
#nav .select li:hover .sub li a {display:inline; background:#005984 url(dropline/sub_sep.gif) top right no-repeat; padding:0 10px; margin:0; font-size:10px; width:auto; white-space:nowrap; font-weight:normal; border:0; color:#fff; height:25px; line-height:24px; }
</style>
以下貼於<body>與</body>之間:
<div id="nav">
<ul class="select"><li><a href="doors_drop_line_three.html?current=one&sub=none"><b>January</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="doors_drop_line_three.html?current=one&sub=a">Fish</a></li>
<li><a href="doors_drop_line_three.html?current=one&sub=b">Chips</a></li>
<li><a href="doors_drop_line_three.html?current=one&sub=c">Bacon</a></li>
<li><a href="doors_drop_line_three.html?current=one&sub=d">Eggs</a></li>
<li><a href="doors_drop_line_three.html?current=one&sub=e">Tomato</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
<ul class="current"><li><a href="doors_drop_line_three.html?current=two&sub=none"><b>February</b>
</a></li></ul><ul class="sub_active">
<li><a href="doors_drop_line_three.html?current=two&sub=a">Sausages</a></li>
<li><a href="doors_drop_line_three.html?current=two&sub=b">Fried Bread</a></li>
<li class="current_sub"><a href="doors_drop_line_three.html?current=two&sub=c">Fillet steak</a></li>
<li><a href="doors_drop_line_three.html?current=two&sub=d">Mushrooms</a></li>
</ul>
<ul class="select"><li><a href="doors_drop_line_three.html?current=three&sub=none"><b>March</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="doors_drop_line_three.html?current=three&sub=a">Lager</a></li>
<li><a href="doors_drop_line_three.html?current=three&sub=b">Beer</a></li>
<li><a href="doors_drop_line_three.html?current=three&sub=c">Red wine</a></li>
<li><a href="doors_drop_line_three.html?current=three&sub=d">Crisps</a></li>
<li><a href="doors_drop_line_three.html?current=three&sub=e">Brandy</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
<ul class="select"><li><a href="doors_drop_line_three.html?current=four&sub=none"><b>April</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="doors_drop_line_three.html?current=four&sub=a">Tea</a></li>
<li><a href="doors_drop_line_three.html?current=four&sub=b">Coffee</a></li>
<li><a href="doors_drop_line_three.html?current=four&sub=c">Milk</a></li>
<li><a href="doors_drop_line_three.html?current=four&sub=d">Squash</a></li>
<li><a href="doors_drop_line_three.html?current=four&sub=e">Lemonade</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
<ul class="select"><li><a href="doors_drop_line_three.html?current=five&sub=none"><b>May</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="doors_drop_line_three.html?current=five&sub=a">Crab</a></li>
<li><a href="doors_drop_line_three.html?current=five&sub=b">Shrimps</a></li>
<li><a href="doors_drop_line_three.html?current=five&sub=c">Lobster</a></li>
<li><a href="doors_drop_line_three.html?current=five&sub=d">Prawns</a></li>
<li><a href="doors_drop_line_three.html?current=five&sub=e">Salmon</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
<ul class="select"><li><a href="doors_drop_line_three.html?current=six&sub=none"><b>June</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="doors_drop_line_three.html?current=six&sub=a">Jam</a></li>
<li><a href="doors_drop_line_three.html?current=six&sub=b">Lemon Curd</a></li>
<li><a href="doors_drop_line_three.html?current=six&sub=c">Marmalade</a></li>
<li><a href="doors_drop_line_three.html?current=six&sub=d">Marmite</a></li>
<li><a href="doors_drop_line_three.html?current=six&sub=e">Bovril</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
<ul class="select"><li><a href="doors_drop_line_three.html?current=seven&sub=none"><b>July</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="doors_drop_line_three.html?current=seven&sub=a">Lamb</a></li>
<li><a href="doors_drop_line_three.html?current=seven&sub=b">Chicken</a></li>
<li><a href="doors_drop_line_three.html?current=seven&sub=c">Pork</a></li>
<li><a href="doors_drop_line_three.html?current=seven&sub=d">Beef</a></li>
<li><a href="doors_drop_line_three.html?current=seven&sub=e">Cheese</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
<ul class="select"><li><a href="doors_drop_line_three.html?current=eight&sub=none"><b>August</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="doors_drop_line_three.html?current=eight&sub=a">Beach</a></li>
<li><a href="doors_drop_line_three.html?current=eight&sub=b">Country walk</a></li>
<li><a href="doors_drop_line_three.html?current=eight&sub=c">Photography</a></li>
<li><a href="doors_drop_line_three.html?current=eight&sub=d">Window shopping</a></li>
<li><a href="doors_drop_line_three.html?current=eight&sub=e">Gardening</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
<ul class="select"><li><a href="doors_drop_line_three.html?current=nine&sub=none"><b>September</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="doors_drop_line_three.html?current=nine&sub=a">Tulips</a></li>
<li><a href="doors_drop_line_three.html?current=nine&sub=b">Sunflower</a></li>
<li><a href="doors_drop_line_three.html?current=nine&sub=c">Cyclamen</a></li>
<li><a href="doors_drop_line_three.html?current=nine&sub=d">Dahlia</a></li>
<li><a href="doors_drop_line_three.html?current=nine&sub=e">Gladiolus</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
<ul class="select"><li><a href="doors_drop_line_three.html?current=ten&sub=none"><b>October</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="doors_drop_line_three.html?current=ten&sub=a">Cup</a></li>
<li><a href="doors_drop_line_three.html?current=ten&sub=b">Saucer</a></li>
<li><a href="doors_drop_line_three.html?current=ten&sub=c">Plate</a></li>
<li><a href="doors_drop_line_three.html?current=ten&sub=d">Fruit bowl</a></li>
<li><a href="doors_drop_line_three.html?current=ten&sub=e">Egg cup</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
<ul class="select"><li><a href="doors_drop_line_three.html?current=eleven&sub=none"><b>November</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="doors_drop_line_three.html?current=eleven&sub=a">Fireside</a></li>
<li><a href="doors_drop_line_three.html?current=eleven&sub=b">Gloves</a></li>
<li><a href="doors_drop_line_three.html?current=eleven&sub=c">Scarves</a></li>
<li><a href="doors_drop_line_three.html?current=eleven&sub=d">Long coat</a></li>
<li><a href="doors_drop_line_three.html?current=eleven&sub=e">Boots</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
<ul class="select"><li><a href="doors_drop_line_three.html?current=twelve&sub=none"><b>December</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="doors_drop_line_three.html?current=twelve&sub=a">Winter</a></li>
<li><a href="doors_drop_line_three.html?current=twelve&sub=b">Skiing</a></li>
<li><a href="doors_drop_line_three.html?current=twelve&sub=c">Snowman</a></li>
<li><a href="doors_drop_line_three.html?current=twelve&sub=d">Christmas</a></li>
<li><a href="doors_drop_line_three.html?current=twelve&sub=e">Crackers</a></li>
<li><a href="doors_drop_line_three.html?current=twelve&sub=f">..and so on</a></li>
<li><a href="doors_drop_line_three.html?current=twelve&sub=g">..'til you get to the end</a></li>
<li><a href="doors_drop_line_three.html?current=twelve&sub=h"> A Happy New Year to all!</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
</div>
|