boder高级应用(4)--step导航

看到这样的导航你是不是也想做出来呢,其实他还是利用border的属性来实现的,下面一个数说明了原理,通过本例,我们对border的会有更深刻的认识

 

代码如下

<style type="text/css">
.wrapper{ padding:20px;}
.flow-steps{ position:relative; height:30px; list-style:none; font-size:14px; overflow:hidden;}
.flow-steps li{ float:left; height:30px; margin-right:-32px; background:#d7d7d7; line-height:30px; overflow:hidden;}
.flow-steps a{ display:block; float:left; width:80px; padding: 0 18px 0 0; text-align:center; color:#333; text-decoration:none;}
.flow-steps b{ float:left; width:0px; height:0px; margin-top:-6px; border:21px solid #d7d7d7; border-left-color:#fff; font-size:0; line-height:0; z-index:9;}
.flow-steps s{ position:relative; float:left; width:0px; height:0px; margin-top:-2px; border:17px solid transparent; /*For IE6*/ _border-color:snow; _filter:chroma(color=snow);/*For IE6*/ border-left-color:#d7d7d7; font-size:0; line-height:0; z-index:99;}
.flow-steps .on{ background:#ff6600;}
.flow-steps .on a{ color:#fff;}
.flow-steps .on b{ border-color:#ff6600; border-left-color:#fff; }
.flow-steps .on s{ border-left-color:#ff6600;}
.flow-steps .f{ border-color:#d7d7d7!important;}
</style>

<div class="wrapper">
<ul class="flow-steps">
<li><b class="f"></b><a href="#">步骤一</a><s></s></li>
<li class="on"><b></b><a href="#">步骤二</a><s></s></li>
<li><b></b><a href="#">步骤三</a><s></s></li>

</ul>
</div>

posted @ 2012-05-31 17:44  红色曼陀罗  阅读(318)  评论(0编辑  收藏  举报