Created
May 18, 2017 00:34
-
-
Save miguelmota/8244ae5fd2b87c052bb6b190efca096e to your computer and use it in GitHub Desktop.
CSS section slants https://jsfiddle.net/zfr3xz3t/1/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.box { | |
width: 100%; | |
height: 200px; | |
background: #0B0D2C; | |
position: relative; | |
} | |
.box:before, | |
.box:after { | |
content: ''; | |
background: inherit; | |
display: block; | |
height: 50%; | |
left: 0; | |
position: absolute; | |
right: 0; | |
z-index: -1; | |
-webkit-backface-visibility: hidden; | |
} | |
.box1:before { | |
top: 0; | |
transform: skewY(-3deg); | |
transform-origin: 100%; | |
} | |
.box1:after { | |
bottom: 0; | |
transform: skewY(3deg); | |
transform-origin: 0 100%; | |
} | |
.box2:before { | |
top: 0; | |
transform: skewY(3deg); | |
transform-origin: 100% 0; | |
} | |
.box2:after { | |
bottom: 0; | |
transform: skewY(-3deg); | |
transform-origin: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment