Skip to content

Instantly share code, notes, and snippets.

@noahub
Created July 17, 2017 05:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noahub/783cf6bc402bf4cc99cb84aa8927c8f8 to your computer and use it in GitHub Desktop.
Save noahub/783cf6bc402bf4cc99cb84aa8927c8f8 to your computer and use it in GitHub Desktop.
Angled Page Sections
<style>
/*This ensures diagonal bg doesn't block page content*/
.lp-positioned-content{
z-index: 100;
}
/*Replace #lp-pom-block-34 with your section ID to create an angled bottom*/
#lp-pom-block-34:after{
background: inherit;
bottom: 0;
content: '';
display: block;
height: 50%;
left: 0;
position: absolute;
right: 0;
transform: skewY(-3.75deg); /*change to increase/decrease angle*/
transform-origin: 100%;
z-index: 1;
}
/*Replace #lp-pom-block-34 with your section ID to create an angled top*/
#lp-pom-block-34:before{
background: inherit;
top: 0;
content: '';
display: block;
height: 50%;
left: 0;
position: absolute;
right: 0;
transform: skewY(-3.75deg); /*change to increase/decrease angle*/
transform-origin: 0;
z-index: 1;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment