I am attempting to design a website layout with trapezoid shapes similar to the attached image. Each section should have a background image that fills the background with cover or a similar effect.
I successfully created the first section (dark blue) using skew and two divs, as shown below.
However, I am facing difficulty in creating the next section where it skews in two directions. I tried using clip-path without success. Lastly, the final section needs to return to a squared-off shape.
HTML
<section id="my_section">
<div id="my_section_bg"></div>
<div id="my_section_content">
<!-- any typical content, text/images here -->
</div>
</section>
CSS
#my_section {
padding-top: 80px;
padding-bottom: 90px;
background-color: rgba(74,90,119,.5);
transform: skewY(-4deg);
}
#my_section_bg {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-image: linear-gradient(
to bottom,
rgba(29,44,71,.85) 0%,
rgba(29,44,71,1) 100%
), url("./assets/my_bg_img.jpeg");
background-color: rgba(29,44,71,1);
transform: skewY(8deg);
}
#my_section_content {
transform: skewY(4deg);
}