用scss画一个五角星
时间: 2023-11-20 14:59:34 浏览: 33
以下是使用SCSS画五角星的代码:
```scss
.star {
width: 0;
height: 0;
border-right: 50px solid transparent;
border-bottom: 35px solid #f1c40f;
border-left: 50px solid transparent;
position: relative;
top: -30px;
&:after {
content: ""; width: 0;
height: 0;
border-right: 50px solid transparent;
border-bottom: 35px solid #f1c40f;
border-left: 50px solid transparent;
position: absolute;
top: 15px;
left: -50px;
transform: rotate(35deg);
}
&:before {
content: "";
width: 0;
height: 0;
border-right: 50px solid transparent;
border-bottom: 35px solid #f1c40f;
border-left: 50px solid transparent;
position: absolute;
top: 15px;
left: 0;
transform: rotate(-35deg);
}
}
```