Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
Rhythm408's button
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By @Rhythm408
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 Rhythm408's button
Rhythm408's button is an animated CSS button by @Rhythm408. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.
- Effects and categories
- Hover effects, 3D, Animated
- 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>Document</title>
<link rel="stylesheet" href="st.css">
</head>
<body>
<button>
<div class="cube">
<div class="top"></div>
<div>
<span style="--i:0;">
<h2>Button!</h2>
<h2>Button!</h2>
</span>
<span style="--i:1;">
<h2>Button!</h2>
<h2>Button!</h2>
</span>
<span style="--i:2;">
<h2>Button!</h2>
<h2>Button!</h2>
</span>
<span style="--i:3;">
<h2>Button!</h2>
<h2>Button!</h2>
</span>
</div>
</div>
</button>
</body>
</html>CSS
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #5b6959;
}
.cube{
position: relative;
width: 300px;
height: 300px;
transform-style: preserve-3d;
transform: rotateX(-30deg);
animation: animate 4s linear infinite;
}
@keyframes animate {
0%{
transform: rotateX(-30deg) rotateY(0deg);
}
100%{
transform: rotateX(-30deg) rotateY(360deg);
}
}
.cube div{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
transform-style: preserve-3d;
}
.cube div span{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background:linear-gradient(#100f0f,#00ec00);
transform: rotateY(calc(90deg*var(--i))) translateZ(150px);
display: flex;
justify-content: center;
align-items: center;
transform-style: preserve-3d;
}
.cube div span h2:hover{
box-shadow:0 0 40px #c3ddc8;
-webkit-animation-duration: 0.3s;
cursor: pointer;
}
.cube div span h2{
position: absolute;
text-align: center;
font-size: 4em;
color: #fff;
transform: translateZ(50px);
}
.cube div span h4:nth-child(1){
transform: translateZ(0) translateY(20px);
color: rgba(0, 0, 0, 0.3)
}
.top{
position: absolute;
top: 0;
left: 0;
width: 300px;
height: 300px;
background: rgb(44, 51, 45,0.8);
transform: rotateX(90deg) translateZ(150px);
}
.top::before{
content: '';
position: absolute;
top: 0;
left: 0;
width: 300px;
height: 300px;
background: rgb(37, 172, 48);
transform: translateZ(-380px);
filter: blur(20px);
box-shadow: 0 0 120px rgba(147, 163, 147, 0.2),
0 0 200px rgba(0, 255, 0,0.4),
0 0 300px rgb(0, 255, 0,0.6),
0 0 400px rgb(0, 255, 0,0.8),
0 0 500px rgb(0, 255, 0,1);
}