I'm trying to create two trapezoids using CSS and have them overlay on top of one another. The problem is that when I use the clip-path attribute, it automatically masks the other div below it. Is there any way for me to create a background image similar to the attached image without using absolute positioning in my div elements?
An example of what I've done so far:
.bg1 {
background-color: #ff0000;
padding: 100px 0;
clip-path: polygon(0 18%, 100% 0, 100% 90%, 0 100%);
}
.bg2 {
background-color: #3f3f3f;
padding: 100px 0;
clip-path: polygon(0 13%, 100% 0, 100% 100%, 0 100%);
}
<div class="bg1">
<div class="bg2">
<h1>Hello World</h1>
</div>
</div>
Example:
