Skip to content

Instantly share code, notes, and snippets.

@ladyjer
Created September 13, 2015 14:04
Show Gist options
  • Save ladyjer/0094c77139a03a8e707e to your computer and use it in GitHub Desktop.
Save ladyjer/0094c77139a03a8e707e to your computer and use it in GitHub Desktop.
CSS to display a zigzag profile on top and bottom of an HTML element. Class 'zigzag'
.zigzag::after {
content:'';
display:block;
height:10px;
background:repeating-linear-gradient(
-45deg,
transparent ,
transparent 50%,
#006ab7 50%,
#006ab7
)
bottom,
repeating-linear-gradient(
45deg,
transparent ,
transparent 50%,
#006ab7 50%,
#006ab7
)
bottom;
background-size:10px 10px;
background-repeat:repeat-x;
box-shadow:0 -100px/* or bigger */ 0 100px transparent;/* this to fill background of parent div */
}
.zigzag::before {
content:'';
display:block;
height:10px;
background:repeating-linear-gradient(
-135deg,
transparent ,
transparent 50%,
#006ab7 50%,
#006ab7
)
top,
repeating-linear-gradient(
135deg,
transparent ,
transparent 50%,
#006ab7 50%,
#006ab7
)
top;
background-size:10px 10px;
background-repeat:repeat-x;
box-shadow:0 -100px/* or bigger */ 0 100px transparent;/* this to fill background of parent div */
}
@cescoferraro
Copy link

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment