Skip to content

Instantly share code, notes, and snippets.

@cagartner
Created May 27, 2019 14:51
Show Gist options
  • Save cagartner/b4b1c76ac9ec87e26f27f22c308a59a7 to your computer and use it in GitHub Desktop.
Save cagartner/b4b1c76ac9ec87e26f27f22c308a59a7 to your computer and use it in GitHub Desktop.
Diagonal CSS container
.hero--diagonal {
position: relative;
background-color: transparent;
&::before {
content: '';
position: absolute;
top: -50px;
left: 0;
width: 100%;
height: calc(100% + 100px);
clip-path: polygon(0% 0%, 100% 50px, 100% 100%, 0% calc(100% - 50px));
}
.hero__content {
position: relative;
z-index: 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment