Skip to content

Instantly share code, notes, and snippets.

@CodeMyUI
Created February 24, 2017 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodeMyUI/5559b03e546428c734791251bcec9bf8 to your computer and use it in GitHub Desktop.
Save CodeMyUI/5559b03e546428c734791251bcec9bf8 to your computer and use it in GitHub Desktop.
Double Slanted Header
<header>
<h1>
My Code Pen
</h1>
<h2>
Double Slanted Header
</h2>
<h3>
Thanks for taking a look!
</h3>
</header>
<div>
<a target="blank" href="http://codepen.io/BadMoodTaylor/pen/KaLjzo">My CodePen for a Polygon Header using Clip</a>
<p>Clip-Path is not very well supported though</p>
</div>
header{
margin: 0; padding: 2em 5em 4em; color: #efefef;
overflow:hidden;
position: relative;
}
header::after{
content:"";
position:absolute;
top:0;
left:0;
height: 100%;
width:100%;
transform: skewY(-4deg);
background: red;
transform-origin: bottom left;
z-index: -1;
}
header::before{
content:"";
position:absolute;
top:0;
left:0;
height: 100%;
width:100%;
transform: skewY(8deg);
background: red;
transform-origin: bottom right;
z-index: -1;
}
body{margin:0; background: #efefef;}
div{padding: 4em;}
header{
display: flex;
flex-flow: column nowrap;
}
header > h3 {align-self: flex-end;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment