-
-
Save schadeck/6871551 to your computer and use it in GitHub Desktop.
Easy trapezoids with 3D transforms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 */ | |
border-radius: 10px 10px 0 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>Trapezoid</p> | |
<p class="tab">Trapezoid tab</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// alert('Hello world!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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