用css html帮我画个五角星
时间: 2023-07-15 10:14:43 浏览: 33
当然可以,以下是一个简单的五角星实现:
HTML代码:
```html
<div class="star"></div>
```
CSS代码:
```css
.star {
width: 0;
height: 0;
border-right: 30px solid transparent;
border-bottom: 50px solid #f2b01e;
border-left: 30px solid transparent;
position: relative;
}
.star:before {
content: "";
width: 0;
height: 0;
border-right: 30px solid transparent;
border-bottom: 20px solid #f2b01e;
border-left: 30px solid transparent;
position: absolute;
top: -20px;
left: -30px;
}
.star:after {
content: "";
width: 0;
height: 0;
border-top: 40px solid #f2b01e;
border-right: 15px solid transparent;
border-left: 15px solid transparent;
position: absolute;
top: 10px;
left: -15px;
}
```
你可以将border属性的值调整以达到自己想要的效果。