css - CSS 中的美女图标形状

标签 css icons css-shapes

如何仅在 CSS 中绘制这个 Belle 图标形状?

enter image description here

我已经在方形元素上尝试了 border-radius 但没有得到准确的 Angular 。

最佳答案

嗯,为了达到准确的效果,即使我们在 border-radius 上使用百分比,我们也不能依赖单个元素。

因此,一种选择是使用两个(伪)元素相互重叠,其中一个元素旋转 90deg:

div {
  width: 300px;
  height: 300px;
  
  /* Just for demo */
  width: 95vmin; height: 95vmin;
  
  position: relative;
}

div:after, div:before {
  content: "";
  background: teal;
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  bottom: 0;
  border-radius: 50% / 22%;
}

div:before {
  transform: rotate(-90deg); /* vendor prefixes omitted due to brevity */
}
<div></div>

关于css - CSS 中的美女图标形状,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29623066/

相关文章:

c# - Jquery Mobile 会自动在我的 "&lt;input type=submit"> 上方添加文本,我该如何防止这种情况发生?

c# - 如何将值设置为图标?

css - 凹凸形状导航使用CSS3

css - 如何在 CSS 中创建不同 Angular 包装器

css - 如何消除两个倾斜图像之间的白色间隙?

javascript - 如何仅在一定分辨率以上显示网站?

html - 带有翅膀的座位图 - 重新开放

css - :before class doesn't work as expected 上的悬停效果

html - 如何使用图标作为 'background-image' 而不是 CSS 中的图像

安卓SDK : What's the license of the included icons?