Back to buttons

Live preview

Preview settings

Changes appear as you type. Use Tab to test keyboard focus.

⌘ / Ctrl + S saves locally

Hover Me! · Ahemtan

HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.

By Ahemtan

Remix button

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 Hover Me! · Ahemtan

Hover Me! · Ahemtan is an animated CSS button by Ahemtan. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.

Effects and categories
Hover effects, Icon
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

<button>
  <span class="text">
      Hover Me!
  </span>
  <svg viewBox="0 0 576 512" xmlns="http://www.w3.org/2000/svg" class="star"><path fill="currentcolor" d="M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"></path></svg>
  <svg viewBox="0 0 384 512" xmlns="http://www.w3.org/2000/svg" class="moon"><path fill="currentcolor" d="M223.5 32C100 32 0 132.3 0 256S100 480 223.5 480c60.6 0 115.5-24.2 155.8-63.4c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-9.8 1.7-19.8 2.6-30.1 2.6c-96.9 0-175.5-78.8-175.5-176c0-65.8 36-123.1 89.3-153.3c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-6.3-.5-12.6-.8-19-.8z"></path></svg>
  <svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" class="meteor"><path fill="currentcolor" d="M493.7 .9L299.4 75.6l2.3-29.3c1-12.8-12.8-21.5-24-15.1L101.3 133.4C38.6 169.7 0 236.6 0 309C0 421.1 90.9 512 203 512c72.4 0 139.4-38.6 175.7-101.3L480.8 234.3c6.5-11.1-2.2-25-15.1-24l-29.3 2.3L511.1 18.3c.6-1.5 .9-3.2 .9-4.8C512 6 506 0 498.5 0c-1.7 0-3.3 .3-4.8 .9zM192 192a128 128 0 1 1 0 256 128 128 0 1 1 0-256zm0 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm16 96a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"></path></svg>
</button>

CSS


button {
  position: relative;
  background: #6a92ef;
  color: white;
  padding: .9rem 2.20rem;
  border-radius: 2rem;
  transition: .5s;
  border: none;
}

button::after {
  content: '';
  width: 80%;
  height: 40%;
  background: linear-gradient(80deg, hsl(217, 77%, 71%) 10%, hsl(218, 76%, 84%) 48%);
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  margin: 0 auto;
  border-radius: 2rem;
  filter: blur(8px);
  z-index: -9;
  opacity: 0;
  transition: opacity .4s;
}

.text {
  position: relative;
  z-index: 10;
}

button svg {
  position: absolute;
  inset: 0;
  margin: auto;
  pointer-events: none;
  transition: .6s;
  opacity: 0;
}

svg.star {
  width: 18px;
  transform: translate(-25px, -6px) rotate(55deg);
  filter: blur(.4px);
  color: hsl(210, 40%, 47%);
}

svg.moon {
  width: 18px;
  transform: translate(7px, -14) rotate(80deg);
  filter: blur(.5px);
  color: hsl(210, 40%, 47%);
}

svg.meteor {
  width: 16px;
  transform: translate(34px, -4px) rotate(-45deg);
  filter: blur(.4px);
  color: hsl(210, 40%, 47%);
}

button:active {
  color: #ffffff;
  transform: scale(1.2);
}

button:hover::after {
  opacity: 1;
}

button:hover {
  transform: scale(1.3);
}

button:hover svg {
  opacity: 1;
}

button:hover svg.star {
  transform: translate(-55px, -20px) rotate(55deg) scale(1.8);
}

button:hover svg.moon {
  transform: translate(50px, -32px) rotate(0deg) scale(1.4);
}

button:hover svg.meteor {
  transform: translate(28px, 30px) rotate(260deg) scale(2);
}