Search code examples
cssbackgroundcss-shapes

How can I create a soft curve in CSS?


Is it possible to create a curved block like in the example image using only CSS (no images/svg) ?

enter image description here


Solution

  • .curveArea {
      width: 500px;
      height: 200px;
      margin: 0 auto;
    }
    
    .mainBox {
      height: 100%;
      background: #fff;
      overflow: hidden;
    }
    
    .curveSection {
      width: 200%;
      height: 100%;
      border-radius: 50%;
      background: #e44627;
      top: 25%;
      left: -50%;
      right: 0;
      position: relative;
      border-top: 10px solid #fdedea;
    }
    <div class="curveArea">
      <div class="mainBox">
        <div class="curveSection"></div>
      </div>
    </div>

    Use this one, I hope it will be helpful