第180天 请使用css画一个圆,方法可以多种
<div class="circle"></div>
1.border-radius
.cirlce{
width:10vw; height:10vw; background:gray;
border-radius:50%;
}
2.clip-path
.circle{
width:10vw; height:10vw; background:gray;
clip-path: circle();
}
3.svg background
.circle{
width:10vw; height:10vw;
background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50%25' cy='50%25' r='50%25' fill='gray'/%3E%3C/svg%3E");
}
4.radial-gradient
.circle{
width:10vw; height:10vw;
background:radial-gradient(gray 70%, transparent 70%);
}
5.font
.circle::after {
content: "●";
font-size: 10vw;//字体实际大小
line-height: 1;
}
6.mix-blend-mode
.circle{
width: 10vw;height: 10vw;background: gray;
}
.circle::after {
content: "";display: block;width: 10vw;height: 10vw;
mix-blend-mode: lighten;
background: radial-gradient(#000 70%, #fff 70%);
}
最常见的就是用border-radius了,其他的 还是看上面那位的吧
Most helpful comment
1.border-radius
2.clip-path
3.svg background
4.radial-gradient
5.font
6.mix-blend-mode