CSS Isometric Button
An isometric block button with skewed side faces that pushes into the page when clicked.
<button class="btn-iso">Build it</button>
.btn-iso {
--depth: 8px;
position: relative;
padding: 15px 34px;
border: 0;
background: #f59e0b;
color: #1c1917;
font: 800 16px/1 system-ui, sans-serif;
cursor: pointer;
transition: transform 0.12s ease;
}
/* Bottom face */
.btn-iso::before {
content: "";
position: absolute;
top: 100%;
left: 0;
width: 100%;
height: var(--depth);
background: #b45309;
transform: skewX(45deg);
transform-origin: top;
transition: height 0.12s ease;
}
/* Right face */
.btn-iso::after {
content: "";
position: absolute;
top: 0;
left: 100%;
width: var(--depth);
height: 100%;
background: #d97706;
transform: skewY(45deg);
transform-origin: left;
transition: width 0.12s ease;
}
.btn-iso:active {
transform: translate(var(--depth), var(--depth));
}
.btn-iso:active::before {
height: 0;
}
.btn-iso:active::after {
width: 0;
}
.btn-iso:focus-visible {
outline: 3px solid #1c1917;
outline-offset: 14px;
}
About this CSS Isometric Button
This CSS Isometric Button is 56 lines of pure CSS (0.9 KB) with no JavaScript and no dependencies. It uses transitions, transforms, keyboard focus styles and custom properties. 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
Change these custom properties to restyle the isometric button without touching the rest of the CSS:
| Property | Default |
|---|---|
--depth | 8px |
How to use this isometric 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-isoclass 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.