I am attempting to replicate the diagonal stripe layout using CSS, similar to the design shown here:
Here is my codepen: http://codepen.io/Chiz/pen/zvWRNW
Although my layout appears acceptable, the issue lies in the "div class="blacktop" not displaying. My intention is for it to overlap the gray div, but it appears that the z-index is ineffective even after setting position:relative to all DIVs.
body {
overflow: hidden;
}
div {
position: relative;
}
div.gray, div.blackbottom {
width: 135%;
height: 450px;
background-color: gray;
margin: -10px 0 0 -140px;
z-index: 100;
-webkit-transform: skew(-20deg, -20deg);
-moz-prop: skew(-20deg, -20deg);
-ms-transform: skew(-20deg, -20deg);
transform: skew(-20deg, -20deg);
-webkit-transform: rotate(8deg);
-moz-prop: rotate(8deg);
-ms-transform: rotate(8deg);
transform: rotate(8deg);
}
div.blackbottom {
margin-top: -100px;
background-color: white;
z-index: 200;
-webkit-transform: rotate(17deg);
-moz-prop: rotate(17deg);
-ms-transform: rotate(17deg);
transform: rotate(17deg);
}
div.blacktop {
width: 135%;
height: 200px;
background-color: black;
z-index: 300;
}
<div class="gray"></div>
<div class="blackbottom"></div>
<div class="blacktop"></div>