无图片制作带有 45 度斜角的导航菜单

带斜角的菜单通常是用图片来实现,而且往往需要避免重叠,本文介绍的是一个不用图片的解决方案,带斜角又不用图片,是不是很不可想象,没错,不用图片也可以做带斜角的导航菜单,赶快看看吧!

无图片制作带有 45 度斜角的导航菜单 – 示例

 
<style type="text/css">
 
/* for this demo only */
#slant {border-top:25px solid #fff; border-bottom:125px solid #fff;}
 
 
/* the stylesheet */
#slant {padding:0; margin:0; list-style:none;}
#slant li {float:left; text-align:center; margin-right:-20px;} 
#slant a {display:block; text-decoration:none;}
#slant a em {font-style:normal; display:block; padding:0 15px; height:25px; background:#363; float:left; cursor:pointer; color:#beb; line-height:24px;}
 
#slant a b, a span {cursor:pointer; display:block; width:0; overflow:hidden; float:left; background:#363;}
 
#slant a span {height:0; border-top:25px solid #363; border-right:25px solid #fff;}
 
#slant a b.p1,
#slant a b.p2,
#slant a b.p3,
#slant a b.p4,
#slant a b.p5 {border-top:5px solid #fff; border-right:5px solid #363;}
 
#slant a b.p1 {height:0; margin-top:20px;}
#slant a b.p2 {height:5px; margin-top:15px;}
#slant a b.p3 {height:10px; margin-top:10px;}
#slant a b.p4 {height:15px; margin-top:5px;}
#slant a b.p5 {height:20px;}
 
#slant a b.p6,
#slant a b.p7,
#slant a b.p8,
#slant a b.p9,
#slant a b.p10 {border-bottom:5px solid #fff; border-left:5px solid #363;}
 
#slant a b.p6 {height:20px;}
#slant a b.p7 {height:15px;}
#slant a b.p8 {height:10px;}
#slant a b.p9 {height:5px;}
#slant a b.p10 {height:0;}
 
#slant a:hover {background:#696;}
 
#slant a:hover em {color:#030; background:#696;}
 
#slant a:hover b.p1,
#slant a:hover b.p2,
#slant a:hover b.p3,
#slant a:hover b.p4,
#slant a:hover b.p5 {border-right-color:#696; background: #696;}
 
#slant a:hover b.p6,
#slant a:hover b.p7,
#slant a:hover b.p8,
#slant a:hover b.p9,
#slant a:hover b.p10 {border-left-color:#696; background: #696;}
 
#slant a:hover span {border-top-color:#696;}
 
</style>
 
<ul id="slant">
 
	<li><a href="#nogo1"><b class="p1"></b><b class="p2"></b><b class="p3"></b><b class="p4"></b><b class="p5"></b><em>Item One</em><span></span></a></li>
 
	<li><a href="#nogo2"><b class="p1"></b><b class="p2"></b><b class="p3"></b><b class="p4"></b><b class="p5"></b><em>Item Two</em><span></span></a></li>
 
	<li><a href="#nogo2"><b class="p1"></b><b class="p2"></b><b class="p3"></b><b class="p4"></b><b class="p5"></b><em>Longer Item Three</em><span></span></a></li>
 
	<li><a href="#nogo2"><b class="p1"></b><b class="p2"></b><b class="p3"></b><b class="p4"></b><b class="p5"></b><em>Four</em><span></span></a></li>
 
	<li><a href="#nogo2"><b class="p1"></b><b class="p2"></b><b class="p3"></b><b class="p4"></b><b class="p5"></b><em>.. and Five</em><span></span></a></li>
 
	<li><a href="#nogo2"><b class="p1"></b><b class="p2"></b><b class="p3"></b><b class="p4"></b><b class="p5"></b><em>6</em><b class="p6"></b><b class="p7"></b><b class="p8"></b><b class="p9"></b><b class="p10"></b></a></li>
 
</ul>

如此创意也许只有 Stu Nicholls 才会有,也许你看过之后会认为完全没有技术难度,但是为什么我们却没有第一个做出来?也许,我们什么都不缺,除了想象力。。。

CSSplay 本站已经多次强烈推荐,如果你的英文够好,可以通过下面的链接阅读原文:
http://www.cssplay.co.uk/menus/slanty.html

本站发布此代码已经通过原作者授权,如果您想转载或者用于其他用途,请直接和原作者联系!

带有二级菜单的滑动门效果

又是 CSSplay ,这个众多网页设计师心目中的圣地,总能带给我们诸多惊喜,Stu Nicholls 那富有创意并且高超的技巧,总能让一个个在我们看来不能实现的愿望变为现实。本文介绍的是他用 CSS 技术实现的带有二级菜单的滑动门效果,相信许多人期待已久了。

带有二级菜单的滑动门效果 – 示例

 
<style type="text/css">
/* ================================================================ 
This copyright notice must be untouched at all times.
 
The original version of this stylesheet and the associated (x)html
is available at http://www.cssplay.co.uk/menus/doors_drop_line_three.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any 
way to fit your requirements.
=================================================================== */
 
/* for this demo only */
#nav {margin:20px 0 80px 0;}
 
/* the styling */
#nav {
	float:left; 
	width:650px; 
	height:auto; 
	background:#fff url("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("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("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("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("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:650px; 
	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:650px; 
	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-top: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("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>
 
<div id="nav">
 
 
<ul class="select"><li><a href="#"><b>January</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="#">Fish</a></li>
<li><a href="#">Chips</a></li>
<li><a href="#">Bacon</a></li>
<li><a href="#">Eggs</a></li>
<li><a href="#">Tomato</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
 
 
<ul class="select"><li><a href="#"><b>February</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub">
<li><a href="#">Sausages</a></li>
<li><a href="#">Fried Bread</a></li>
<li><a href="#">Fillet steak</a></li>
<li><a href="#">Mushrooms</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
 
 
<ul class="select"><li><a href="#"><b>March</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="#">Lager</a></li>
<li><a href="#">Beer</a></li>
<li><a href="#">Red wine</a></li>
<li><a href="#">Crisps</a></li>
<li><a href="#">Brandy</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
 
 
<ul class="select"><li><a href="#"><b>April</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="#">Tea</a></li>
<li><a href="#">Coffee</a></li>
<li><a href="#">Milk</a></li>
<li><a href="#">Squash</a></li>
<li><a href="#">Lemonade</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
 
 
<ul class="current"><li><a href="#"><b>May</b>
</a></li></ul><ul class="sub_active"><li><a href="#">Crab</a></li>
<li><a href="#">Shrimps</a></li>
<li><a href="#">Lobster</a></li>
<li class="current_sub"><a href="#">Prawns</a></li>
<li><a href="#">Salmon</a></li>
</ul>
 
 
<ul class="select"><li><a href="#"><b>June</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="#">Jam</a></li>
<li><a href="#">Lemon Curd</a></li>
<li><a href="#">Marmalade</a></li>
<li><a href="#">Marmite</a></li>
<li><a href="#">Bovril</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
 
 
<ul class="select"><li><a href="#"><b>July</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="#">Lamb</a></li>
<li><a href="#">Chicken</a></li>
<li><a href="#">Pork</a></li>
<li><a href="#">Beef</a></li>
<li><a href="#">Cheese</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
 
 
<ul class="select"><li><a href="#"><b>August</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="#">Beach</a></li>
<li><a href="#">Country walk</a></li>
<li><a href="#">Photography</a></li>
<li><a href="#">Window shopping</a></li>
<li><a href="#">Gardening</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
 
 
<ul class="select"><li><a href="#"><b>September</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="#">Tulips</a></li>
<li><a href="#">Sunflower</a></li>
<li><a href="#">Cyclamen</a></li>
<li><a href="#">Dahlia</a></li>
<li><a href="#">Gladiolus</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
 
 
<ul class="select"><li><a href="#"><b>October</b>
<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]--><ul class="sub"><li><a href="#">Cup</a></li>
<li><a href="#">Saucer</a></li>
<li><a href="#">Plate</a></li>
<li><a href="#">Fruit bowl</a></li>
<li><a href="#">Egg cup</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]--></li></ul>
 
 
</div>

您可以通过下面的链接访问 cssplay 原页面:
http://www.cssplay.co.uk/menus/doors_drop_line_three.html

用 Javascript 制作可折叠式导航菜单

当栏目级别较多时,很多人都会考虑使用可折叠式导航菜单,既方便点击又节省空间,本文介绍的是对可折叠式导航菜单的简单实现,希望对新手有帮助。

用 Javascript 制作可折叠式导航菜单 – 示例

 
<script type="text/javascript">
// 说明:用 Javascript 制作可折叠式导航菜单
// 整理:http://www.CodeBit.cn

// curr_id : 当前id ; total_num 总共有几个菜单
function switchMenu(curr_id, total_num)
{
	for(var i=0; i<total_num; i++)
	{
		//二级菜单
		var el = document.getElementById('menu_sub_'+i);

		if(!el) return;

		//一级菜单前面的图片
		var img = document.getElementById('menu_master_'+i);

		if(i == curr_id)
		{
			el.style.display = "block";
			img.src = "img/open.gif";
		}
		else
		{
			el.style.display = "none";
			img.src = "img/close.gif";
		}
	}
}
</script>
 
<style type="text/css">
<!--
#warp {
	width:200px;
	margin:100px auto;
}
.menu_master {
	border:1px solid #ccc;
	padding:5px 10px;
	margin-bottom:2px;
	cursor:pointer;
	font-weight:bold;
	color:#666;
}
.menu_master img { vertical-align:middle; }
.sub_menu { display:none; }
.sub_menu ul, .sub_menu ul li {
	margin:0;
	padding:0;
	list-style:none;
}
.sub_menu ul li a {
	margin:0 0 3px 10px;
	padding:3px 0 2px 25px;
	background:url('img/fw.gif') no-repeat 5px center;
	display:block;
	height:18px;
	border-bottom:1px solid #eee;
	color:#666;
	text-decoration:none;
}
-->
</style>


<div id="warp">

	<div class="menu_master" onclick="javascript:switchMenu(0, 4);">
		<img src="close.gif" alt="close" id="menu_master_0" /> PHP/MySQL
	</div>
	<div id="menu_sub_0" class="sub_menu">
		<ul>
			<li><a href="http://www.codebit.cn/pub/html/php_mysql/tutorial/" title="PHP/MySQL教程">PHP/MySQL教程</a></li>
			<li><a href="http://www.codebit.cn/pub/html/php_mysql/tip/" title="PHP/MySQL小技巧">PHP/MySQL小技巧</a></li>
			<li><a href="http://www.codebit.cn/pub/html/php_mysql/problem/" title="PHP/MySQL常见问题">PHP/MySQL常见问题</a></li>
		</ul>
	</div>

	<div class="menu_master" onclick="javascript:switchMenu(1, 4);">
		<img src="close.gif" alt="close" id="menu_master_1" /> (X)HTML/CSS
	</div>
	<div id="menu_sub_1" class="sub_menu">
		<ul>
			<li><a href="http://www.codebit.cn/pub/html/xhtml_css/tutorial/" title="(X)HTML/CSS教程">(X)HTML/CSS教程</a></li>
			<li><a href="http://www.codebit.cn/pub/html/xhtml_css/tip/" title="(X)HTML/CSS小技巧">(X)HTML/CSS小技巧</a></li>
		</ul>
	</div>

	<div class="menu_master" onclick="javascript:switchMenu(2, 4);">
		<img src="close.gif" alt="close" id="menu_master_2" /> Ajax
	</div>
	<div id="menu_sub_2" class="sub_menu">
		<ul>
			<li><a href="http://www.codebit.cn/pub/html/ajax/tutorial/" title="Ajax教程">Ajax教程</a></li>
			<li><a href="http://www.codebit.cn/pub/html/ajax/tip/" title="Ajax小技巧">Ajax小技巧</a></li>
		</ul>
	</div>

	<div class="menu_master" onclick="javascript:switchMenu(3, 4);">
		<img src="close.gif" alt="close" id="menu_master_3" /> Javascript
	</div>
	<div id="menu_sub_3" class="sub_menu">
		<ul>
			<li><a href="http://www.codebit.cn/pub/html/javascript/tutorial/" title="Javascript教程">Javascript教程</a></li>
			<li><a href="http://www.codebit.cn/pub/html/javascript/tip/" title="Javascript小技巧">Javascript小技巧</a></li>
		</ul>
	</div>

</div>

用 UL 制作的纵向导航菜单效果

导航菜单可以说是网站制作中最常见的工作,当然,由于他的重要性(基本上整个网站所有页面都会显示),所以,有不少设计师在上面花费了很多心血。本文介绍的是对纵向导航菜单的最简单的实现,相信明白了实现原理后,你可以制作出属于自己的精彩的导航效果,到时,可别忘了和大家共享哟!

用 UL 制作的纵向导航菜单效果 – 示例

 
<style type="text/css">
#navsite {
	font-family: Verdana, Helvetica, Arial, sans-serif;
	font-size: 0.7em;
	font-weight: bold;
	width: 12em; 
	border-right: 1px solid #666; 
	padding: 0; 
	margin-bottom: 1em; 
	background-color: #9cc; 
	color: #333; 
}
#navsite ul {
	list-style: none; 
	margin: 0; 
	padding: 0; 
}
#navsite ul li {
	margin: 0; 
	border-top: 1px solid #003;
}
#navsite ul li a {
	display: block; 
	padding: 2px 2px 2px 0.5em; 
	border-left: 10px solid #369; 
	border-right: 1px solid #69c;
	border-bottom: 1px solid #369;
	background-color: #036; 
	color: #fff; 
	text-decoration: none; 
	width: 100%; 
}
html>body #navsite ul li a { 
	width: auto; 
}
#navsite ul li a:hover {
	border-left: 10px solid #036;
	border-right: 1px solid #69c;
	border-bottom: 1px solid #369; 
	background-color: #69f; 
	color: #fff; 
}
 
</style>
 
<div id="navsite">
	<ul>
		<li><a href="http://www.codebit.cn">首页</a></li>
		<li><a href="http://www.codebit.cn/pub/article.php">技术文章</a></li> 
		<li><a href="http://www.codebit.cn/pub/contact.php">联系我们</a></li>
		<li><a href="http://www.codebit.cn/pub/submit.php">提交文章</a></li>
		<li><a href="http://feeds.feedburner.com/codebit">RSS 订阅</a></li>
	</ul>
</div>

用 CSS 实现的三级导航菜单

用 css 实现一级导航菜单是很容易的,但是需要多级导航的时候,我们往往需要借助 javascript, 本文介绍的是 Stu Nicholls 用纯 CSS 实现的三级导航菜单。他的站点 cssplay.co.uk 上有许多很棒的的 CSS 实例,极力推荐!

用 CSS 实现的三级导航菜单 – 示例

 
.menu {
	width:750px; 
	font-size:0.85em;
	position:relative;
	z-index:100;
}
/* remove all the bullets, borders and padding from the default list styling */
.menu ul {
	padding:0;
	margin:0;
	list-style-type:none;
}
.menu ul ul {
	width:150px;
}
/* float the list to make it horizontal and a relative positon so that you can control the dropdown menu positon */
.menu li {
	float:left;
	width:150px;
	position:relative;
}
/* style the links for the top level */
.menu a, .menu a:visited {
	display:block;
	font-size:11px;
	text-decoration:none; 
	color:#fff; 
	width:139px; 
	height:30px; 
	border:1px solid #fff; 
	border-width:1px 1px 0 0; 
	background:#758279; 
	padding-left:10px; 
	line-height:29px;
}
/* a hack so that IE5.5 faulty box model is corrected */
* html .menu a, * html .menu a:visited {
	width:150px;
	width:139px;
}
 
/* style the second level background */
.menu ul ul a.drop, .menu ul ul a.drop:visited {
	background:#d4d8bd url(../img/drop.gif) bottom right no-repeat;
}
/* style the second level hover */
.menu ul ul a.drop:hover{
	background:#c9ba65 url(../img/drop.gif) bottom right no-repeat;
}
.menu ul ul :hover > a.drop {
	background:#c9ba65 url(../img/drop.gif) bottom right no-repeat;
}
/* style the third level background */
.menu ul ul ul a, .menu ul ul ul a:visited {
	background:#e2dfa8;
}
/* style the third level hover */
.menu ul ul ul a:hover {
	background:#b2ab9b;
}
 
 
/* hide the sub levels and give them a positon absolute so that they take up no room */
.menu ul ul {
	visibility:hidden;
	position:absolute;
	height:0;
	top:31px;
	left:0; 
	width:150px;
}
/* another hack for IE5.5 */
* html .menu ul ul {
	top:30px;
	top:31px;
}
 
/* position the third level flyout menu */
.menu ul ul ul{
	left:150px; 
	top:0;
	width:150px;
}
/* position the third level flyout menu for a left flyout */
.menu ul ul ul.left {
	left:-150px;
}
 
/* style the table so that it takes no ppart in the layout - required for IE to work */
.menu table {position:absolute; top:0; left:0;}
 
/* style the second level links */
.menu ul ul a, .menu ul ul a:visited {
	background:#d4d8bd; 
	color:#000; 
	height:auto; 
	line-height:1em; 
	padding:5px 10px; 
	width:129px
	/* yet another hack for IE5.5 */
}
* html .menu ul ul a{
	width:150px;
	width:129px;
}
 
 
/* style the top level hover */
.menu a:hover, .menu ul ul a:hover{
	color:#fff; 
	background:#949e7c;
}
.menu :hover > a, .menu ul ul :hover > a {
	color:#fff;
	background:#949e7c;
}
 
/* make the second level visible when hover on first level list OR link */
.menu ul li:hover ul,
.menu ul a:hover ul{
	visibility:visible; 
}
/* keep the third level hidden when you hover on first level list OR link */
.menu ul :hover ul ul{
	visibility:hidden;
}
 
/* make the third level visible when you hover over second level list OR link */
.menu ul :hover ul :hover ul{ 
	visibility:visible;
}
 
<div class="menu">
 
<ul>
<li><a href="./menu/index.html">DEMOS<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul>
	<li><a href="../menu/zero_dollars.html" title="The zero dollar ads page">zero dollars advertising page</a></li>
	<li><a href="../menu/embed.html" title="Wrapping text around images">wrapping text around images</a></li>
	<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>
	<li><a href="../menu/nodots.html" title="Removing active/focus borders">active focus</a></li>
	<li><a class="drop" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click with no borders<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
		<ul>
			<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>
			<li><a href="../menu/nodots.html" title="Removing active/focus borders">removing active/focus borders</a></li>
			<li><a href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click</a></li>
		</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
	</li>
	<li><a class="drop" href="./menu/shadow_boxing.html" title="Multi-position drop shadow">shadow boxing<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
		<ul>
			<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>
			<li><a href="../menu/nodots.html" title="Removing active/focus borders">removing active/focus borders</a></li>
			<li><a href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click</a></li>
		</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
	</li>
	<li><a class="drop" href="../menu/old_master.html" title="Image Map for detailed information">image map for detailed information<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
		<ul>
			<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>
			<li><a href="../menu/nodots.html" title="Removing active/focus borders">removing active/focus borders</a></li>
			<li><a href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click</a></li>
		</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
	</li>
	<li><a href="../menu/bodies.html" title="fun with background images">fun with background images</a></li>
	<li><a href="../menu/fade_scroll.html" title="fade-out scrolling">fade scrolling</a></li>
	<li><a href="../menu/em_images.html" title="em size images compared">em image sizes compared</a></li>
	</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li><a href="./boxes/index.html">BOXES<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul>
	<li><a href="spies.html" title="a coded list of spies">a coded list of spies</a></li>
	<li><a href="vertical.html" title="a horizontal vertical menu">vertical menu</a></li>
	<li><a href="expand.html" title="an enlarging unordered list">enlarging unordered list</a></li>
	<li><a href="enlarge.html" title="an unordered list with link images">link images</a></li>
	<li><a href="cross.html" title="non-rectangular links">non-rectangular</a></li>
	<li><a href="jigsaw.html" title="jigsaw links">jigsaw links</a></li>
	<li><a href="circles.html" title="circular links">circular links</a></li>
	</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li><a href="./mozilla/index.html">MOZILLA<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul>
	<li><a href="../mozilla/dropdown.html" title="A drop down menu">drop down menu</a></li>
	<li><a href="../mozilla/cascade.html" title="A cascading menu">cascading menu</a></li>
	<li><a href="../mozilla/content.html" title="Using content:">content:</a></li>
	<li><a href="../mozilla/moxbox.html" title=":hover applied to a div">mozzie box</a></li>
	<li><a href="../mozilla/rainbow.html" title="I can build a rainbow">I can build a rainbow with transparent borders</a></li>
	<li><a href="../mozilla/snooker.html" title="Snooker cue">a snooker cue using border art</a></li>
	<li><a href="../mozilla/target.html" title="Target Practise">target practise</a></li>
	<li><a href="../mozilla/splittext.html" title="Two tone headings">two tone headings</a></li>
	<li><a href="../mozilla/shadow_text.html" title="Shadow text">shadow text</a></li>
	</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li><a href="./ie/index.html">EXPLORER<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul>
	<li><a href="../ie/exampleone.html" title="Example one">the first example for Internet Explorer</a></li>
	<li><a href="../ie/weft.html" title="Weft fonts">weft fonts</a></li>
	<li><a href="../ie/exampletwo.html" title="Vertical align">vertically aligning text</a></li>
	</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<li><a href="./opacity/index.html">OPACITY<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
	<ul>
	<li><a href="../opacity/colours.html" title="colour wheel">a colour wheel using opaque colours</a></li>
	<li><a href="../opacity/picturemenu.html" title="a menu using opacity">a menu using opacity</a></li>
	<li><a href="../opacity/png.html" title="partial opacity">partial opacity</a></li>
	<li><a href="../opacity/png2.html" title="partial opacity II">partial opacity II</a></li>
	<li><a class="drop" href="../menu/hover_click.html" title="Hover/click with no active/focus borders">HOVER/CLICK<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
		<ul class="left">
			<li><a href="../menu/form.html" title="Styling forms">styled form</a></li>
			<li><a href="../menu/nodots.html" title="Removing active/focus borders">removing active/focus borders</a></li>
			<li><a href="../menu/hover_click.html" title="Hover/click with no active/focus borders">hover/click</a></li>
		</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
	</li>
	</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>
 
</div>

用 UL 制作的横向导航菜单效果

导航菜单可以说是网站制作中最常见的工作,当然,由于他的重要性(基本上整个网站所有页面都会显示),所以,有不少设计师在上面花费了很多心血。本文介绍的是对横向导航菜单的最简单的实现,相信明白了实现原理后,你可以制作出属于自己的精彩的导航效果,到时,可别忘了和大家共享哟!

用 UL 制作的横向导航菜单效果 – 示例

 
<style type="text/css">
#navsite h5 {
	display: none;
}
#navsite ul {
	padding: 3px 0; 
	margin-left: 0; 
	border-bottom: 1px solid #778; 
	font: bold 12px Verdana, sans-serif; 
}
 
#navsite ul li {
	list-style: none;
	margin: 0; 
	display: inline; 
}
 
#navsite ul li a {
	padding: 3px 0.5em; 
	margin-left: 3px; 
	border: 1px solid #778;
	border-bottom: none;
	background: #DDE;
	text-decoration: none;
}
 
#navsite ul li a:link {
	color: #448;
}
 
#navsite ul li a:visited {
	color: #667;
}
 
#navsite ul li a:link:hover, #navsite ul li a:visited:hover {
	color: #000;
	background: #AAE;
	border-color: #227;
}
 
#navsite ul li a#current {
	background: white; 
	border-bottom: 1px solid white;
}
</style>
 
<div id="navsite">
	<h5>Site navigation:</h5>
	<ul>
		<li><a href="#">首页</a></li>
		<li><a href="#">关于</a></li> 
		<li><a href="#">档案</a></li>
		<li><a href="#">作品</a></li>
		<li><a href="#" id="current">演讲</a></li> 
		<li><a href="#">联系</a></li>
	</ul>
</div>

可见,用这种方式做的导航,结构清晰,HTML代码简洁,改版时更是方便,根据本文的内容,相信您很容易做出符合自己网站风格的导航。