按钮 CSS 上带有尖边的圆角

Ral*_*lph 1 html css css-shapes

我正在考虑在按钮之前和之后使用伪元素来实现这个圆边三角形(旋转)和尖角。请参阅照片以获得所需的结果。

Tem*_*fif 5

你可以尝试这样的事情:

.box {
  width: 300px;
  height: 80px;
  --c: #000;
  position: relative;
  line-height: 80px;
  font-size: 20px;
  text-align: center;
  color: #fff;
  z-index: 0;
}

.box:before,
.box:after {
  content: "";
  position: absolute;
  background:linear-gradient(#000,#000) top/100% 50% no-repeat;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: -1;
}

.box:before {
  border-radius: 60px 60px 0 0;
}

.box:after {
  border-radius: 0 0 60px 60px;
  background-position:bottom;
}
Run Code Online (Sandbox Code Playgroud)
<div class="box">
  Some text
</div>
Run Code Online (Sandbox Code Playgroud)