Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
3D Button
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By @Nishusk
Button submission checks
Checks will appear after the preview updates.
Buttons only: no full pages, forms, cards or navigation. Put scripts in the JavaScript tab. Tailwind uses utilities from HTML and JavaScript; use complete class names. Custom CSS supports plain CSS, without @apply, imports or plugins.
Accessibility quick check
Waiting for the rendered preview…
Try Tab, Enter and Space in the preview. Check the focus ring, hover and disabled states, then enable Reduce motion. These checks are guidance, not an accessibility certification.
Explore freely here. Remix to publish your version with credit to the creator.
About 3D Button
3D Button is an animated CSS button by @Nishusk. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.
- Effects and categories
- Hover effects
- Using this example
- Copy the HTML or download index.html, style.css and app.js. Test keyboard focus, motion and contrast in your own project.
Usage, Tailwind and licensing questions
Read the source files
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3D Button</title>
<link href="https://fonts.googleapis.com/css?family=Grand+Hotel"/>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<button class="elevated">Click me!</button>
<br>
<br>
<br>
<button class="rounded">Click me!</button>
</body>
</html>CSS
body {
background: #DEDCDD;
text-align: center;
padding: 60px;
}
*, body {
font-family: 'Grand Hotel', sans-serif;
}
/* replace the button styles below to your custom class */
button {
height: 80px;
width: 240px;
font-size: 32px;
border-radius: 20px;
cursor: pointer;
border: none;
}
button:hover {
color: #ED8C82;
text-shadow: 1px 1px 2px #F6A7A7, 0 0 1.45px #ED8C82, 0 0 1.45px rgba(0, 0, 0, 0.25);
/* box-shadow: 3px 3px 8px #ED8C82, -3px -3px 8px #ED8C82; */
}
/* Elevated */
.elevated {
background: linear-gradient(0.45turn, #D4D2D2, #EEECED);
box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.35), -3px -3px 8px rgba(255, 255, 255, 0.6);
}
.elevated:active {
color: #e1e1e1;
background: linear-gradient(90turn, #F6C7CC, #D2837D);
box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.35), inset -2px -3px 5px rgba(255, 255, 255, 0.9);
}
/* Rouned */
.rounded {
box-shadow: rgba(0, 0, 0, 0.17) 0px -23px 25px 0px inset, rgba(0, 0, 0, 0.15) 0px -36px 30px 0px inset, rgba(0, 0, 0, 0.1) 0px -79px 40px 0px inset, rgba(0, 0, 0, 0.06) 0px 2px 1px, rgba(0, 0, 0, 0.09) 0px 4px 2px, rgba(0, 0, 0, 0.09) 0px 8px 4px, rgba(0, 0, 0, 0.09) 0px 16px 8px, rgba(0, 0, 0, 0.09) 0px 32px 16px;
}
.rounded:active {
color: #e1e1e1;
background: linear-gradient(90turn, #F6C7CC, #D2837D);
box-shadow: rgba(50, 50, 93, 0.25) 0px 30px 60px -12px inset, rgba(0, 0, 0, 0.3) 0px 18px 36px -18px inset;
}