CSS Retro Bevel Button
A classic Windows 95 style gray button with beveled edges that invert when pressed.
HTML
<button class="btn-bevel">OK</button>
CSS
.btn-bevel {
min-width: 88px;
padding: 7px 20px;
border: 0;
border-radius: 0;
background: #c0c0c0;
color: #000;
font: 14px/1.2 Tahoma, "MS Sans Serif", Geneva, sans-serif;
box-shadow:
inset -1px -1px #0a0a0a,
inset 1px 1px #fff,
inset -2px -2px #808080,
inset 2px 2px #dfdfdf;
cursor: pointer;
}
.btn-bevel:active {
padding: 8px 19px 6px 21px;
box-shadow:
inset -1px -1px #fff,
inset 1px 1px #0a0a0a,
inset -2px -2px #dfdfdf,
inset 2px 2px #808080;
}
.btn-bevel:focus-visible {
outline: 1px dotted #000;
outline-offset: -5px;
}
About this CSS Retro Bevel Button
This CSS Retro Bevel Button is 29 lines of pure CSS (0.6 KB) with no JavaScript and no dependencies. It uses box shadows and keyboard focus styles. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.
CSS features used
Customize it
The colors in this snippet. Search and replace them to match your brand:
#c0c0c0#000#0a0a0a#fff#808080#dfdfdf
How to use this retro bevel button
- Copy the HTML and paste it where you want the element to appear.
- Copy the CSS into your stylesheet, or inside a
<style>tag. - Keep the
.btn-bevelclass name, or rename it in both places. Then tweak colors, sizes and timing to match your design. - Using React or Next.js? Change
classtoclassNamein the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).
Building with an AI tool?
“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.