ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
1. 使用background-clip 可以指定背景区域 如: ~~~ .box { width: 10px; height: 10px; padding: 5px; border-radius: 50%; border:2px solid; background: #09bb07; background-clip: content-box; } <div class="box"></box> ~~~ ![](https://box.kancloud.cn/245cee26662b01c8724a652936bde38d_56x37.png) 通过background-clip指定背景颜色作用的区域,通过padding制定 空白的地方,再用border设置外边框的颜色。这样就可以绘制图形了