i'm struggling about this: i need to put 4 elements inline keeping image and text straight but skewing the container. I tried many different solutions (pseudo elements, skew positive and negative, clip path, ecc. They works with a single image but i can't handle multiple elements and find a solution. I also would need to keep images as background images because of responsiveness.
This is the screenshot to what i get:
I need to make straight image and text keeping the paralelogram in the container like this:
Here's my code:
HTML
<div class="image-front-container" style="height: 199px;">
<div class="image-front background-image-formatter fill" style="background-image:url('http://mysite/image1.jpg')">
</div>
<a href="/mysite/mypage" class="front-main-anchors"></a>
<div class="image-front-title"><span>Image 1</span></div>
</div>
Image 2
Image 3
CSS
.image-front-container {
border: 10px solid transparent;
width: 25%;
float: left;
/*-webkit-transform: skew(-20deg);*/
/*-moz-transform: skew(-20deg);*/
/*-o-transform: skew(-20deg);*/
/*-webkit-clip-path: polygon(0 4%, 95% 0, 99% 100%, 4% 93%);*/
height: 400px;
}
.image-front {
height: 100%;
width: 100%;
background-size: cover;
background-position: center center;
transition: background-image .5s ease-in-out;
-webkit-transition: background-image .5s ease-in-out;
-moz-transition: background-image .5s ease-in-out;
}
.image-front-title {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
text-transform: uppercase;
color: white;
font-weight: bold;
text-align: center;
line-height: 30px;
-moz-box-shadow: inset 0 30px 0 rgba(0, 0, 0, 0.85);
-webkit-box-shadow: inset 0 30px 0 rgba(0, 0, 0, 0.85);
box-shadow: inset 0 30px 0 rgba(0, 0, 0, 0.85);
}
Thank you!