I have a landing page with a curve background. Please refer to the following image. I would like to know the best approach when coding this from CSS. I also need to make this responsive and I'm using bootstrap as a CSS framework. Following is what I have done.
I have used an SVG image as the background and used it with :before pseudo-class to display in the bottom. And also I have removed width and height from the SVG and kept the view box and added preserveAspectRatio="xMinYMin meet" to SVG to make it responsive. (Please note these attributes not added to the example in JSFiddle)
What is the best approach to create these curvy backgrounds?
.hero-container {
background-image: url(https://images.unsplash.com/photo-1581362508717-f542c1ecf295?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1651&q=80);
background-size: cover;
background-repeat: no-repeat;
background-position: top center;
padding: 16.625rem 0;
}
.hero-container:after {
content: url('http://svgshare.com/i/Hud.svg');
position: absolute;
width: 100%;
height: auto;
bottom: -85px;
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css">
<section class="hero-container position-relative">
<div class="container">
<div class="row">
<div class="col-md-7 col-xs-12">
<h1 class="mb-3">Lorem ipsum dolor sit amet</h1>
<p class="mb-4 text-white">Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet</p>
<button class="btn btn-secondary">Register My Club</button>
</div>
</div>
</div>
</section>