Skip to content

Instantly share code, notes, and snippets.

@csssecrets
Last active October 21, 2023 12:46
Show Gist options
  • Select an option

  • Save csssecrets/f2d98791ab1f0b238aa9 to your computer and use it in GitHub Desktop.

Select an option

Save csssecrets/f2d98791ab1f0b238aa9 to your computer and use it in GitHub Desktop.
Parallelograms — with pseudoelements
/**
* 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);
}
<a href="#yolo" class="button"><div>Click me</div></a>
<button class="button"><div>Click me</div></button>
// 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