上面有很多非常好的CSS样本。
下面给出一个横向菜单的例子,使用在导航条上,可以达到不错的效果。
效果演示
CSS代码
- 代码: 全选
<style type="text/css">
/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */
#invertedtabs{
margin-left: 4px;
padding: 0;
width: 100%;
background: transparent;
voice-family: "\"}\"";
voice-family: inherit;
padding-left: 5px;
}
#invertedtabs ul{
font: bold 14px Arial, Verdana, sans-serif;
margin:0;
margin-bottom: 1em; /*margin between menu and rest of content*/
padding:0;
list-style:none;
}
#invertedtabs li{
display:inline;
margin:0 2px 0 0;
padding:0;
text-transform:uppercase;
line-height: 1.5em;
}
#invertedtabs a{
float:left;
color: white;
background: #8b0000 url(media/color_tabs_left2.gif) no-repeat left bottom;
margin:0 2px 0 0;
padding:0 0 0 3px;
text-decoration:none;
letter-spacing: 1px;
}
#invertedtabs a span{
float:left;
display:block;
background: transparent url(media/color_tabs_right2.gif) no-repeat right bottom;
padding:3px 9px 3px 6px;
}
#invertedtabs a span{
float:none;
}
#invertedtabs a:hover{
background-color: #d50509;
}
#invertedtabs a:hover span{
background-color: #d50509;
}
#invertedtabs #current a, #invertedtabs #current span{ /*currently selected tab*/
background-color: #d50509;
}
#invertedtabsline{
clear: both;
padding: 0;
width: 100%;
height: 8px;
line-height: 8px;
background: #8b0000;
border-bottom: 1px solid #fff; /*Remove this to remove border between bar and tabs*/
}
</style>
HTML代码
- 代码: 全选
<div id="invertedtabsline"> </div>
<div id="invertedtabs">
<ul>
<li style="margin-left: 1px"><a href="http://demo.zen-cart.cn" title="Home"><span>首页</span></a></li>
<li><a href="http://demo.zen-cart.cn/products_new.html" title="New Product"><span>新进商品</span></a></li>
<li><a href="http://demo.zen-cart.cn/specials.html" title="Specials"><span>特价商品</span></a></li>
<li id="current"><a href="http://demo.zen-cart.cn/page.html?id=8" title="Intro"><span>公司简介</span></a></li>
<li><a href="http://demo.zen-cart.cn/contact_us.html" title="About Us"><span>联系我们</span></a></li>
</ul>
</div>
<br style="clear: left" />












News