I have a parent container width 3 (or more) child div's including images. When I skew my child divs they are bigger than the parent div so they are not nicely skewed.
I want to achieve this:
I have tried the following:
<div class="parent">
<div class="child">
<!-- Image -->
</div>
<div class="child">
<!-- Image -->
</div>
<div class="child">
<!-- Image -->
</div>
</div>
With the following style:
.parent{
display:flex;
flex-wrap:wrap;
justify-content: space-between;
}
.child{
width:30%;
height:375px;
transform: skew(-45deg);
overflow:hidden; //Because i want to insert images inside it
transform-origin: bottom right;
background:red;
}
But this give me not the right result
So to clarify, this is what I want:
but this is what I get: