当前位置:编程学习 > JS >>

带缺口的CSS导航栏

带缺口的国外CSS菜单,修正了部分代码,请先运行一下看效果,缺口指明了菜单的当前项,使结构更加清淅一点,整体灰色风格,适合大多数网站的情况。
答案:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>带缺口的CSS导航栏</title>
<style type="text/css">
.preload16 {background: url(/jscss/demoimg/200906/pro16_2.gif);}
.preload16a {background: url(/jscss/demoimg/200906/pro16_2a.gif);}
.pro16 {padding:0 0 0 1em; margin:0; list-style:none; height:43px; position:relative; background:transparent url(/jscss/demoimg/200906/pro16_back.gif) repeat-x left top; font-size:11px;}
.pro16 li {float:left; height:43px;}
.pro16 li a {display:block; float:left; height:40px; line-height:35px; color:#888; text-decoration:none; font-family:arial, verdana, sans-serif; font-weight:bold; text-align:center; padding:0 0 0 10px; cursor:pointer; background:url(/jscss/demoimg/200906/pro16_0a.gif) no-repeat;}
.pro16 li a b {float:left; display:block; padding:0 60px 0 0; background:url(/jscss/demoimg/200906/pro16_0.gif) no-repeat right top;}
.pro16 li.current a {color:#000; background:url(/jscss/demoimg/200906/pro16_2a.gif) no-repeat;}
.pro16 li.current a b {color:#000; background:url(/jscss/demoimg/200906/pro16_2.gif) no-repeat right top;}
.pro16 li a:hover {color:#000; background: url(/jscss/demoimg/200906/pro16_2a.gif) no-repeat;}
.pro16 li a:hover b {color:#000; background:url(/jscss/demoimg/200906/pro16_2.gif) no-repeat right top;}
.pro16 li.current a:hover {color:#000; cursor:default;}
</style>
</head>
<body>

<ul class="pro16">
<li><a href="#"><b>网站首页</b></a></li>
<li><a href="#"><b>网页特效</b></a></li>
<li><a href="#"><b>Products</b></a></li>
<li><a href="#"><b>站长资源库</b></a></li>
<li class="current"><a href="#"><b>Contact us</b></a></li>
<li><a href="#"><b>Search</b></a></li>
</ul>

</body>
</html>

上一个:CSS二级菜单,圆角兼容性好
下一个:适应产品类网站点击向两侧展开的菜单

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,