先看看我们要实现的效果
思路就是使用CSS元素的伪类实现!
1.::after中使用border绘制出三角形。
2.::before中绘制长方形,border 只显示两边,并隐藏其他两边,然后旋转一下,作为勾勾。
下面是 CSS 代码:
&::after {
position: absolute;
right: 0;
bottom: 0;
width: 0;
height: 0;
content: "";
border: 20px solid;
border-color: transparent #3d6cec #3d6cec transparent;
border-bottom-right-radius: 2px;
}
&::before {
position: absolute;
right: 2px;
bottom: 10px;
z-index: 1;
width: 20px;
height: 11px;
content: '';
background: transparent;
border: 3px solid white;
border-top: none;
border-right: none;
-webkit-transform: rotate(-55deg);
-ms-transform: rotate(-55deg);
transform: rotate(-55deg);
}
原文链接:https://blog.csdn.net/weixin_42164539/article/details/125645092
本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。
还没有人抢沙发呢~