Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
lakhan06's button
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By @lakhan06
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 lakhan06's button
lakhan06's button is an animated CSS button by @lakhan06. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.
- Effects and categories
- Hover effects, Icon, 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 name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class ="frame">
<a href="#" class="btn">
<i class="fas fa-backward"></i>
</a>
<a href="#" class="btn">
<i class="fas fa-play"></i>
</a>
<a href="#" class="btn">
<i class="fas fa-forward"></i>
</a>
</div>
</body>
</html>CSS
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
width: 100vw;
margin: -8px;
background: #e0e5ec;
}
.frame{
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
height: 80px;
width: 350px;
position: relative;
box-shadow:
-7px -7px 20px 0px #fff9,
-4px -4px 5px 0px #fff9,
7px 7px 20px 0px #0002,
4px 4px 5px 0px #0001,
inset 0px 0px 0px 0px #fff9,
inset 0px 0px 0px 0px #0001,
inset 0px 0px 0px 0px #fff9, inset 0px 0px 0px 0px #0001;
transition:box-shadow 0.6s cubic-bezier(.79,.21,.06,.81);
border-radius: 10px;
}
.btn{
height: 50px;
width: 50px;
border-radius: 3px;
background: #e0e5ec;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-tap-highlight-color: transparent;
box-shadow:
-7px -7px 20px 0px #fff9,
-4px -4px 5px 0px #fff9,
7px 7px 20px 0px #0002,
4px 4px 5px 0px #0001;
transition:box-shadow 0.6s cubic-bezier(.79,.21,.06,.81);
font-size: 26px;
color: #666;
text-decoration: none;
}
.btn:hover{
background: radial-gradient(circle, #0ff 0%, #e0e5ec 60%);
color: rgba(102,102,102,.5);
animation: colorchange 3s linear infinite;
}
.btn:active{
box-shadow: 4px 4px 6px 0 rgba(255,255,255,.5),
-4px -4px 6px 0 rgba(116, 125, 136, .2),
inset -4px -4px 6px 0 rgba(255,255,255,.5),
inset 4px 4px 6px 0 rgba(116, 125, 136, .3);
}
@keyframes colorchange {
to {filter: hue-rotate(360deg);}
}