Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
sukanyachopra's button
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
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 sukanyachopra's button
sukanyachopra's button is an animated CSS button by @sukanyachopra. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.
- Effects and categories
- Hover effects, 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>
<head>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="center">
<button class="animated-button">Hover Me</button>
</div>
<script src="script.js"></script>
</body>
</html>
-->
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<!-- Stripe Text Background -->
<div class="container">
<div class="stripe-container">
<button class="stripe-background">BUTTON</button>
</div>
</div>
</body>
</html>
CSS
/* Body and Container Settings */
/* Center shapes */
body {
margin: 0;
padding: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
}
/* Set blue background and light gray border */
.container {
width: 500px;
height: 250px;
border: 5px solid lightgray;
background: transparent;
position: relative;
margin: 5px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 20px;
}
/* Stripe Container */
.stripe-container {
width: 500px;
height: 250px;
font: 900 5.5rem sans-serif;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
background: black;
border-radius: 20px;
}
/* Stripe Background Gradient */
button{
width: 500px;
height: 250px;
font: italic 1.2em "Fira Sans", serif;
font-weight: 900;
cursor: pointer;
border-radius: 20px;
}
.stripe-background {
background: repeating-linear-gradient(
45deg,
transparent,
transparent 20px,
white 60px
),
linear-gradient(
10deg,
royalblue,
#5768df,
#8164d7,
#aa60c8,
#cc60b3,
#e3689c,
#ed7889,
#ee8c7e,
#e99e7c,
#e4ac7f,
#e0b585,
burlywood
);
/* Background Text Clip */
/* webkit vendor prefix start */
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
/* webkit vendor prefix end */
background-clip: text;
}
.stripe-background:hover{
animation: stripe-text-animation 2.5s alternate infinite;
}
/* Stripe Text Animation */
@keyframes stripe-text-animation {
from {
background-position: 0 100px;
}
to {
background-position: 300px 300px;
}
}