JSFiddle - React, Tailwind, and code Playground
by aichforhuman
HTML
<div class="button blue large">Submit</div>
<div class="button blue small">Submit</div>
CSS
.button {
display: inline-block; /* forces div width to conform to content */
border-radius: 5px; /* creates rounded corners */
padding: 8px 12px;
cursor: pointer; /* show pointer on mouseover */
user-select: none; /* prevent text selection */
transition: 0.2s; /* makes the hover behavior smoother */
font-family: sans-serif;
}
.button:hover {
filter: brightness(110%); /* Brightens the current background color by +10% */
}
.button.blue {
background-color: #5DADE2;
color: #fff;
}
.button.small {
font-size: 0.8em;
}
.button.large {
font-size: 1.2em;
padding: 10px 20px; /* Give the button more room since it is bigger! */
}