Last active
October 21, 2023 12:46
-
-
Save csssecrets/f2d98791ab1f0b238aa9 to your computer and use it in GitHub Desktop.
Parallelograms — with pseudoelements
This file contains hidden or 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
| /** | |
| * Parallelograms — with pseudoelements | |
| */ | |
| .button { | |
| position: relative; | |
| display: inline-block; | |
| padding: .5em 1em; | |
| border: 0; margin: .5em; | |
| background: transparent; | |
| color: white; | |
| text-transform: uppercase; | |
| text-decoration: none; | |
| font: bold 200%/1 sans-serif; | |
| } | |
| .button::before { | |
| content: ''; /* To generate the box */ | |
| position: absolute; | |
| top: 0; right: 0; bottom: 0; left: 0; | |
| z-index: -1; | |
| background: #58a; | |
| transform: skew(45deg); | |
| } |
This file contains hidden or 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
| <a href="#yolo" class="button"><div>Click me</div></a> | |
| <button class="button"><div>Click me</div></button> |
This file contains hidden or 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 hidden or 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