I'm trying to make a website layout ideally consisting of multiple divs, where I'd like each one to have a slanted bottom, going into the one below.
Here's a look at the mockup so far:
@charset "utf-8";
/* CSS Document */
* {
margin: 0;
font-size: 10px;
}
.red {
position: relative;
height: 500px;
background: red;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 5vw));
}
.blue {
height: 500px;
margin-top: -5vw;
background: blue;
}
.green {
height: 500px;
margin-top: -5vw;
background: green;
}
.orange {
height: 500px;
margin-top: -5vw;
background: orange;
}
.purple {
height: 500px;
margin-top: -5vw;
background: purple;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="red"></div>
<div class="blue"></div>
<div class="green"></div>
<div class="orange"></div>
<div class="purple"></div>
</body>
</html>
As you can tell, I can only get the first div to maintain the apperance I'd like of the slanted bottom.
I've snatched some code from somewhere, and I can get the first div box to slant the way I'd like over the other, using clip-path. My problem is, I'd like for the next div to also have a slanted bottom - presumably by using clip path? - but when I attempt this, it works, but the first 'clip-path slant' reverts back to being non-existant.
Because - as I mentioned earlier - I've snatched the code from somewhere, I do not fully understand the values of the clip-path properties that I'm looking at.
Hopefully I've not been too confusing, and thanks for your help in advance!