首页 > Web开发 > 详细

CSS绘制三角形和箭头

时间:2019-09-13 22:15:17      阅读:65      评论:0      收藏:0      [点我收藏+]

三角形

.sanjiaoxing{
position: relative;
top: 3px;
display: inline-block;
margin-left: 8px;
width: 0;
height: 0;
border-width: 5px;  //宽度
border-style: solid;
border-color: #BBBBBB transparent transparent transparent;      //方向
}

 


箭头
.arrTop{
position: absolute;
}
.arrTop:before,.arrTop:after{
position: absolute;
content: ‘‘;
border-top: 8px transparent dashed;
border-left: 8px transparent dashed;
border-right: 8px transparent dashed;
border-bottom: 8px #fff solid;
}
.arrTop:before{
border-bottom:8px rgba(200, 200, 200, 1) solid;
}
.arrTop:after{
top: 1px; /*覆盖并错开1px*/
border-bottom:8px #fff solid;
}

 

 

.arrBottom{
position: absolute;
}
.arrBottom:before,.arrBottom:after{
position: absolute;
content: ‘‘;
border-bottom: 8px transparent dashed;
border-left: 8px transparent dashed;
border-right: 8px transparent dashed;
border-top: 8px #fff solid;
}
.arrBottom:before{
border-top:8px rgba(200, 200, 200, 1) solid;
}
.arrBottom:after{
top: -1px; /*覆盖并错开1px*/
border-top:8px #fff solid;
}

CSS绘制三角形和箭头

原文:https://www.cnblogs.com/mrt-yyy/p/11517690.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!