Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
onkar2921's button
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By @onkar2921
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 onkar2921's button
onkar2921's button is an animated CSS button by @onkar2921. 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=butt, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<button class="button">
<span>NEXT</span>
</button>
</body>
</html>CSS
*{
padding: 0px;
margin: 0px;
box-sizing: border-box;
}
body{
justify-content: center;
display: flex;
align-items: center;
height: 100vh;
background-color: black;
}
.button{
text-align: center;
font-size: 18;
font-weight: 700;
display: inline;
border: 2px solid yellow;
background:black;
color: white;
height: 50px;
width: 100px;
cursor: pointer;
border-radius: 5rem;
font-family: serif;
font-style: italic;
font-variant: small-caps;
/* box-shadow: 5px 5px 8px gray, 5px 5px 8px green; */
box-shadow: 0 0 10px 5px #48abe0,
0 0 20px 7px #ebecca,
0 0 25px 20px #8a2be2,
0 0 5px 5px #ff1493;
}
.button:hover{
transition-duration: 0ms;
background-color:green;
color: black;
font-weight: 800;
font-size: 16;
border: 2px solid white;
border-radius:50%;
font-family:serif;
text-shadow: 1px 1px white;
box-shadow: 5px 5px 8px red;
box-shadow: 5px 5px 5px gray 0px 0px 0px none 5px 5px 5px red ;
cursor: pointer;
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}