Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
Neon Hover Effect
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By @ann29-tdk
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 Neon Hover Effect
Neon Hover Effect is an animated CSS button by @ann29-tdk. 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>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js"> <!--<![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Neon Hover Effect</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
</head>
<body>
<a href="#">
<span>Click me</span>
<div class="a"></div>
<div class="b"></div>
</a>
<div class="shadow"></div>
<script src="" async defer></script>
</body>
</html>CSS
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins' , sans-serif;
}
body{
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
flex-direction: column;
gap: 40px;
background: #091921;
}
a{
position: absolute;
background: #091921;
color: #fff;
font-size: 2.3em;
letter-spacing: 0.1em;
font-weight: 400;
padding: 30px 90px;
transition: 0.3s;
text-decoration: none;
border-radius: 25px;
}
/* a:hover{
letter-spacing: 0.25em;
color: #f00;
border-radius: 7.5px;
box-shadow: 0 0 10px #f00, 0 0 20px #f00, 0 0 30px #f00;
} */
i{
position: absolute;
}
.a::before{
position: absolute;
content: '';
height: 30px;
top: -15px;
left: -15px;
width: 30px;
background: #091921;
border: 3px solid #ff00aa;
z-index: 4;
transition: 0.3s;
}
.b::before{
position: absolute;
content: '';
height: 30px;
bottom: -15px;
right: -15px;
width: 30px;
background: #091921;
border: 3px solid #aa00ff;
z-index: 4;
transition: 0.3s cubic-bezier(0.78, 0.16, 0.18, 0.81);
}
a:hover{
letter-spacing: 0.5em;
border: none;
color: #ff00aa;
border-bottom-right-radius: 25px;
border-top-left-radius: 25px;
text-shadow: 0 0 10px #aa00ff,0 0 20px #aa00ff,0 0 30px #aa00ff;
}
a:hover .a::before{
right: 50px;
box-shadow: 0 0 10px #ff00aa, 0 0 20px #ff00aa;
transform: rotate(45deg);
}
a:hover .b::before{
box-shadow: 0 0 10px #aa00ff, 0 0 20px #aa00ff;
/* right: 385px; */
transform: rotate(45deg);
}
.shadow::before{
content: '';
z-index: -2;
top: -5px;
left: -15px;
position: absolute;
background: transparent;
transition: 0.3s;
height: 130px;
width: 330px;
filter: blur(15px);
background: linear-gradient(to right, #ff00aa, #aa00ff);
}
.shadow{
position: absolute;
background: transparent;
height: 120px;
width: 300px;
z-index: -2;
transition: 0.3s cubic-bezier(0.78, 0.16, 0.18, 0.81);
}
.shadow::before:hover{
width: 330px;
}