A Pen by Jørn A. Myrland on CodePen.
Created
March 13, 2014 12:15
-
-
Save jmyrland/9527316 to your computer and use it in GitHub Desktop.
A Pen by Jørn A. Myrland.
This file contains hidden or 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
<div class="zigzag-edges"> | |
<h2> | |
Hey, look at my ZigZag! | |
</h2> | |
</div> |
This file contains hidden or 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
html, body { | |
background: #8CCEE8; | |
} | |
div { | |
width: 180px; | |
padding: 2em; | |
margin: 2em; | |
} | |
.zigzag-edges { | |
position: relative; | |
background: #FBFBFC; | |
} | |
.zigzag-edges:before, | |
.zigzag-edges:after { | |
content: ' '; | |
display: block; | |
height: 14px; | |
position: absolute; | |
left: 0; | |
right: 0; | |
} | |
.zigzag-edges:before{ | |
top: -14px; | |
background: | |
linear-gradient(45deg, #FCFCFB 25%, transparent 25%), | |
linear-gradient(315deg, #FCFCFB 25%, transparent 25%), | |
linear-gradient(225deg, #8CCEE8 25%, transparent 25%) -7px 0, | |
linear-gradient(135deg, #8CCEE8 25%, transparent 25%) -7px 0; | |
background-size: 14px 14px; | |
background-color: #DCDCDB; | |
} | |
.zigzag-edges:after{ | |
bottom: -14px; | |
background: | |
linear-gradient(135deg, #FCFCFB 25%, transparent 25%), | |
linear-gradient(225deg, #FCFCFB 25%, transparent 25%), | |
linear-gradient(315deg, #8CCEE8 25%, transparent 25%) -7px 0, | |
linear-gradient(45deg, #8CCEE8 25%, transparent 25%) -7px 0; | |
background-size: 14px 14px; | |
background-color: #DCDCDB; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment