Skewing div
by labanino
HTML
<section id="skew1">
<div class="container">
<div class="row">
<div class="col-md-12 contents">
<h2>This is my skew1!</h2>
<p>And this is my paragraph.</p>
</div>
</div>
</div>
</section>
<section id="skew2">
<div class="huge-container">
<div class="container">
<div class="row">
<div class="col-sm-12">
<h2>This is my skew2!</h2>
<p>And this is my paragraph.</p>
</div>
</div>
</div>
</div>
</section>
CSS
body {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #333;
background-color: #fff;
text-align: left;
}
p {
color: #fff;
}
#skew1 p {
font-size: 30px;
font-weight: 300;
color: #fff;
margin: 0;
}
h2 {
color: #fff;
font-size: 170px;
font-weight: 300;
margin: 0;
letter-spacing: -15px;
text-align: left;
}
::selection {
background: rgb(255,255,43);
color: #222;
}
#skew1:before {
content: ' ';
display: block;
min-height: 300px;
width: 100%;
background: #02000a;
-webkit-transform: skewY(-3deg) translateZ(0);
-moz-transform: skewY(-3deg) translateZ(0);
-ms-transform: skewY(-3deg) translateZ(0);
-o-transform: skewY(-3deg) translateZ(0);
transform: skewY(-3deg) translateZ(0);
position: absolute;
left: 0;
bottom: -50px;
z-index: 1;
overflow: hidden;
}
#skew1 {
background: #02000a;
padding: 30px 0 0 0; /* 150px 0 300px */
}
#skew1 .contents {
position: relative;
z-index: 8;
}
#skew2 h2 {
z-index: 10;
position: relative;
}
#skew2 p {
font-size: 20px;
font-weight: 400;
}
#skew2 {
background: #7D41FF;
background-image: -webkit-linear-gradient(35deg,#00009a,#b300b3);
background-image: linear-gradient(35deg,#00009a,#b300b3);
padding: 120px 0 170px 0;
}
#skew2:before {
content: ' ';
display: block;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(44,255,44,0.67);
-webkit-transition: all 225ms ease;
-moz-transition: all 225ms ease;
transition: all 225ms ease;
opacity: 0;
}
#skew2:after {
content: ' ';
display: block;
height: 110px;
width: 100%;
background: #0B0021;
/*
-webkit-transform: skewY(0deg) translateZ(0);
-moz-transform: skewY(0deg) translateZ(0);
-ms-transform: skewY(0deg) translateZ(0);
-o-transform: skewY(0deg) translateZ(0);
transform: skewY(0deg) translateZ(0);
*/
position: absolute;
left: 0;
bottom: 0;
...