Skip to content

Instantly share code, notes, and snippets.

@msankhala
Forked from LeaVerou/dabblet.css
Created October 29, 2013 06:30
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 msankhala/7209958 to your computer and use it in GitHub Desktop.
Save msankhala/7209958 to your computer and use it in GitHub Desktop.
Easy trapezoids with 3D transforms
/**
* Easy trapezoids with 3D transforms
*/
p {
position: relative;
display: inline-block;
padding: 1em;
margin: 2em;
}
p::before {
content: ''; /* To generate the box */
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
z-index: -1;
background: skyblue;
transform: perspective(4px) rotateX(1deg);
}
p.tab::before {
/* Tip by @krofdrakula */
}
<p>Trapezoid</p>
<p class="tab">Trapezoid tab</p>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment