CSS Button Creator

Arcade CSS button

Retro pixel-font game button. Hover, click and tab to it to see every state.

Customize this button →

CSS

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: 16px 24px;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  color: #ffffff;
  background: #ef4444;
  border: 0;
  border-radius: 0px;
  box-shadow: 0 5px 0 0 #7f1d1d, 0 0 0 3px #000000, inset 0 -4px 0 0 #b91c1c;
  text-shadow: 2px 2px 0 #7f1d1d;
  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__icon {
  display: inline-block;
  transition: transform 80ms linear;
}

.btn:hover {
  filter: brightness(1.12000000000000010658141036401502788066864013671875);
}

.btn:hover .btn__icon {
  transform: translateX(-3px);
}

.btn:active {
  transform: translateY(5px);
  box-shadow: 0 0 0 0 #7f1d1d, 0 0 0 3px #000000, inset 0 -4px 0 0 #b91c1c;
  transition-duration: 40ms;
}

.btn:focus-visible {
  outline: 3px solid #facc15;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn__icon {
    transition: none;
    animation: none;
  }
}

HTML

<button class="btn" type="button">
  <span class="btn__icon" aria-hidden="true">★</span>
  Get started
</button>

How this button is built

How to use it

  1. Copy the CSS into your stylesheet. The @import line loads the Press Start 2P font from Google Fonts. Move it to the top of your file, or drop it if you already load the font.
  2. Paste the HTML where you want the button. It works on <button>, <a> and <input type="submit">.
  3. Change the label, or rename the .btn class 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.