I'm trying to create a layout with 3 divs side by side, fluid size (I'll handle small screen sizes separately), where the inner sides are slanted. It's supposed to be something like:
|_/_/_| or |_/_\_|
Either would be fine. I've tried the following, but I don't think it's the correct solution.
.holder .mainSelection {
display: flex;
overflow: hidden;
width: 100%;
height: 200px;
border: 2px solid black;
}
.mainSelection .box {
height: 100%;
transform: skew(15deg);
position: relative;
}
.mainSelection .box:nth-child(1) {
background: #F40C42;
margin-left: -30px;
flex: 0 0 33%;
}
.mainSelection .box:nth-child(2) {
background: #DBF408;
flex: 0 0 34%;
border-left: 2px solid black;
border-right: 2px solid black;
}
.mainSelection .box:nth-child(3) {
background: #58F40B;
flex: 0 0 33%;
}
.mainSelection .box:nth-child(3):after {
content: "";
position: absolute;
width: 100px;
height: 100%;
background: #58F40B;
-webkit-transform: skewX(-15deg);
right: -50px;
}
The problem with the code above is that the 3rd div is bigger than the first two.
Can anyone suggest a better solution?