css实现一个缺口小三角

.square{  
     width:0;  
     height:0;  
     margin:0 auto;  
     border:6px solid transparent;  
     border-bottom: 6px solid red;  //自行调整方向,.
 } 

带缺口的三角形:

<div class="box b1"></div>  
<div class="box b2"></div> 
.box{  
    position: absolute;  
    left: 0;  
    top: 0;  
    width: 0;  
    height:0;  
    border: 6px solid transparent;  
}  
.b1{  
    border-bottom-color:#000 ;  
}  
.b2{  
    border-bottom-color:#fff ;  
} 

 

posted @ 2017-02-19 22:59  党兴明  阅读(4344)  评论(0编辑  收藏  举报