80s Sunset CSS button
Outrun gradient with tall condensed lettering. Hover, click and tab to it to see every state.
CSS
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: .5em;
padding: 10px 34px;
font-family: 'Bebas Neue', sans-serif;
font-size: 24px;
font-weight: 400;
line-height: 1.2;
letter-spacing: 0.11999999999999999555910790149937383830547332763671875em;
text-transform: uppercase;
color: #ffffff;
background: linear-gradient(180deg, #f59e0b 0%, #db2777 50%, #7c3aed 100%);
border: 0;
border-radius: 4px;
box-shadow: 0 0 0 2px rgba(253, 230, 138, .90000000000000002220446049250313080847263336181640625), 0 0 28px 0 rgba(219, 39, 119, .59999999999999997779553950749686919152736663818359375);
text-shadow: 2px 2px 0 #4c1d95;
cursor: pointer;
text-decoration: none;
white-space: nowrap;
-webkit-tap-highlight-color: transparent;
transition: transform 80ms linear, box-shadow 80ms linear, filter 80ms linear;
}
.btn:hover {
filter: brightness(1.12000000000000010658141036401502788066864013671875);
}
.btn:active {
transform: translateY(1px) scale(0.979999999999999982236431605997495353221893310546875);
transition-duration: 40ms;
}
.btn:focus-visible {
outline: 3px solid #f59e0b;
outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
.btn {
transition: none;
animation: none;
}
}
HTML
<button class="btn" type="button">
Drive
</button>
How this button is built
- Background: a 3-stop
linear-gradient()at 180° (#f59e0b → #db2777 → #7c3aed). - Type: Bebas Neue, weight 400, 24px, uppercase, letter-spacing 12px, in #ffffff.
- Shape: 4px rounded corners with 10px × 34px padding.
- Depth: a coloured glow and a text shadow.
- Interaction: on hover it brightens slightly, and it squishes slightly when clicked, with 80ms transitions.
- Accessibility: a visible
:focus-visiblering for keyboard users, and all motion turns off underprefers-reduced-motion.
How to use it
- Copy the CSS into your stylesheet. The
@importline loads the Bebas Neue font from Google Fonts. Move it to the top of your file, or drop it if you already load the font. - Paste the HTML where you want the button. It works on
<button>,<a>and<input type="submit">. - Change the label, or rename the
.btnclass if it clashes with your framework. Want a different colour or size? Open it in the editor, change it visually, and copy the new code.