How to round out corners when using CSS clip-path

前端 未结 6 1815
孤城傲影
孤城傲影 2021-01-04 00:56

I want to be able to round out the 3 leftmost corners on this shape that I have created, any idea how that can be done?

6条回答
  •  渐次进展
    2021-01-04 01:53

    An SVG filter can round any kind of clip-path. You simply need to apply it to a parent element. Adjust the stdDeviation to control the radius:

    .box {
      width: 423px;
      height: 90px;
      background-color: #b0102d;
      color: white;
      clip-path: polygon(100% 0%, 100% 50%, 100% 100%, 25% 100%, 0% 50%, 25% 0%);
    }
    
    .parent {
      filter: url('#goo');
      overflow:hidden;
      position: fixed;
      right:-50px;
      z-index: 1;
      margin-top: 10vw;
    }

    Related: https://stackoverflow.com/a/65485455/8620333

提交回复
热议问题