左下角和右上角的样式怎么写呢?
其实就是“内凹圆角”怎么绘制?
可以参考一下这篇文章,共列举了 5 种方式
https://segmentfault.com/a/1190000040372386
不过你这里是纯色,可以直接用伪元素拼接的方式
<div class="test test1"></div>
<div class="test test2"></div>
<div class="test test3"></div>
<div class="test test4"></div>
<style>
.test {
width: 20px;
height: 20px;
background: #000;
margin: 10px;
}
.test1 {
background: radial-gradient(circle at 0 0,transparent 20px,#e91e63 21px);
}
.test2 {
background: radial-gradient(circle at 0 100%,transparent 20px,#e91e63 21px);
}
.test3 {
background: radial-gradient(circle at 100% 0,transparent 20px,#e91e63 21px);
}
.test4 {
background: radial-gradient(circle at 100% 100%,transparent 20px,#e91e63 21px);
}
</style>
10 回答11.1k 阅读
6 回答3k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.7k 阅读✓ 已解决
3 回答5.1k 阅读✓ 已解决
5 回答2k 阅读