Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
3D CSS buttons
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 CSS buttons
3D CSS buttons 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, Icon, Social
- 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 CSS buttons</title>
<link rel="stylesheet" href="styles.css">
<script src="https://kit.fontawesome.com/b078cd548f.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="main">
<div class="button" id="one">
<i class="fa-brands fa-codepen"></i> - CODEPEN</div>
<div class="button" id="two"><i class="fa-brands fa-github"></i> - GITHUB</div>
<div class="button" id="three"><i class="fa-brands fa-twitter"></i> - TWITTER</div>
</div>
</body>
</html>CSS
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
body {
width: 100%;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: #00203fff;
}
.main {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-evenly;
}
.button {
background-color: #3bba9c;
color: #00203fff;
width: 20vw;
height: 6vw;
text-align: center;
line-height: 6vw;
transform: skew(25deg) rotate(-20deg);
transition: 0.5s;
font-size: 2vw;
font-family: 'Roboto', sans-serif;
font-weight: 300;
text-shadow: 0px 0px 10px #adefd1ff;
box-shadow: -1.5vw 1.5vw 1vw #000000;
border-bottom: 1px solid #00203fff;
cursor: pointer;
letter-spacing: 0.2vw;
position: relative;
}
.button::after {
content: "";
position: absolute;
width: 100%;
height: 1.5vw;
background-color: #2abf9f;
bottom: -1.5vw;
left: -0.75vw;
transform: skew(-45deg);
}
.button::before {
content: "";
position: absolute;
background-color: #2abf9f;
width: 1.5vw;
height: 100%;
left: -1.5vw;
top: 0.75vw;
transform: skewY(-45deg);
border-bottom: 1px solid #00203fff;
}
.button:hover {
transform: translateY(-30px) skew(25deg) rotate(-20deg);
box-shadow: -60px 40px 100px #589bf7;
}
.button:active {
color: #1f7f90;
transform: translateY(-10px) skew(25deg) rotate(-20deg);
}