How can I place text over a skewed div with a background image? Despite using the ::before pseudo element, the text is appearing behind the image. Here's an example of what I'm attempting to achieve:
Html
<div class="diag-right">Text Here</div>
CSS
.diag-right {
height:220px;
float:right;
width:260px;
position: relative;
overflow: hidden;
outline: 1px solid transparent;
left: -120px;
transform: skew(-20deg);
-o-transform: skew(-20deg);
-moz-transform: skew(-20deg);
-webkit-transform: skew(-20deg);
-ms-transform: skew(-20deg);
-sand-transform: skew(-20deg);
}
.diag-right::before {
content: "";
position: absolute;
width: 370px;
height: 100%;
top: 0;
left: -40px;
background: url("http://imgur.com/T25mFEV.jpg") 0 0 repeat;
transform: skew(20deg);
-o-transform: skew(20deg);
-moz-transform: skew(20deg);
-webkit-transform: skew(20deg);
-ms-transform: skew(20deg);
-sand-transform: skew(20deg);
}
Live Example
Any suggestions on how to accomplish this or find a suitable workaround?