微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何仅使用CSS创建自定义的鸡蛋状弯曲形状?

如何解决如何仅使用CSS创建自定义的鸡蛋状弯曲形状?

我要创建这种自定义白色形状,而在CSS中没有购物车图标。我该怎么办?

strong textenter image description here

解决方法

使用边界半径

border-radius:70% 30% 30% 70% / 60% 40% 60% 40%;

类似图片

enter image description here

演示

.cart-div{
  background:#2c44a3;
  width:200px;
  height:200px;
  padding:50px;
}
.shape{
  background:#fff;
  width:180px;
  height:180px;
  color:#111;
  border-radius:58% 42% 63% 37% / 35% 31% 69% 65%;
  display:flex;
  align-items:center;
  justify-content:center;
}
<div class="cart-div">
  <div class="shape">
  cart icon
  </div>
</div>

可以制作不同的形状吗?访问here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。