CSS shape with inset curve and transparent background

后端 未结 2 1410
广开言路
广开言路 2020-12-02 00:36

I need to create a CSS shape like this image..

\"enter

Please check this fiddl

2条回答
  •  渐次进展
    2020-12-02 01:23

    You can use a pseudo element with border-radius and background-shadows to create the curve and enable a transparent background for the curve.

    Output :

    CSS Shape with thransparent inset curve

    #shape {
      width: 300px; height: 100px;
      position: relative;
      overflow: hidden;
    }
    
    #shape:before {
      content: '';
      position: absolute;
      top: 10%; right: 0;
      width: 300%;
      padding-bottom: 300%;
      border-radius: 100%;
      background: none;
      box-shadow: 10px -10px 5px 300px #F15723;
      z-index: -1;
    }
    
    body{background:url(https://farm9.staticflickr.com/8461/8048823381_0fbc2d8efb.jpg);background-size:cover;}

    demo

提交回复
热议问题