CSS3形状还是SVG?

时间:2018-08-23 11:49:42

标签: css3 svg

是否可以使用CSS3?还是应该使用svg?

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以使用CSS做到这一点:

body {
  margin: 0;
}

.box {
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.box:before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  left: 43px;
  background: #2f99ce;
  border-radius: 100px/190px 0 0 0;
  transform: skewX(-20deg);
  transform-origin: left bottom;
}

.box:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 51px;
  height: 36px;
  background: radial-gradient(circle at top left, transparent 69%, #2f99ce 70%);
  transform: skewX(-20deg);
  transform-origin: left bottom;
}
<div class="box">
</div>