其他分享
首页 > 其他分享> > css画箭头

css画箭头

作者:互联网

css画箭头
双箭头

//外层可以加标签用来定位
<view class="arrow-right">
 	<view></view>
 	<view></view>
 </view>
.arrow-right {
    display: flex;
    width: 40rpx;
    height: 40rpx;
	transform: rotate(90deg);/*改变箭头的方向*/
}
.arrow-right view {
    width: 10rpx;
    height: 10rpx;
    position: relative;
    margin: 0 2rpx;
}
.arrow-right view:before {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    right: 0;
    width: 0;
    height: 0;
    border: 10rpx solid;
    margin-top: -10rpx;
    border-color: transparent transparent transparent #cccccc); /* 箭头颜色 */
}
.arrow-right view:after {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    right: 2rpx; /*位置偏移,决定箭头的粗细*/
    width: 0;
    height: 0;
    border: 10rpx solid;
    margin-top: -10rpx;
    border-color: transparent transparent transparent #fff;/* 与模块底色相同*/
}

单箭头

<view class="a"><view>
.a {
	width:10rpx;
	height:10rpx;
	border-left:2rpx solid #cccccc;
	border-top:2rpx solid #cccccc;
	transform: rotate(-45deg);/*改变箭头的方向*/
}

标签:right,height,箭头,css,border,transparent,10rpx
来源: https://blog.csdn.net/weixin_44550952/article/details/121222928