CSS Button Creator

Win95 CSS button

Grey 90s desktop button with bevelled edges. Hover, click and tab to it to see every state.

CSS

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: 8px 36px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: #000000;
  background: #c0c0c0;
  border: 0;
  border-radius: 0px;
  box-shadow: inset -1px -1px 0 0 #0a0a0a, inset 1px 1px 0 0 #ffffff, inset -2px -2px 0 0 #808080, inset 2px 2px 0 0 #dfdfdf;
  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:active {
  transform: none;
  transition-duration: 40ms;
}

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

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

HTML

<button class="btn" type="button">
  OK
</button>

How this button is built

How to use it

  1. Copy the CSS into your stylesheet. The @import line loads the Helvetica / Arial 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.