Skip to content

Animated Hover Buttons

Eight pure CSS hover buttons with fill, diagonal, sliding text, border drawing, arrow, underline and press effects that also run on focus.

Also known as: button hover effects, animated button collection, fill hover buttons, border draw button

Animated Hover Buttons live demo

Open in new tab

Pure CSS code (HTML, CSS)

A set of eight animated hover buttons in pure CSS: fill, slide and border-drawing effects with square corners, bold uppercase labels and a warm paper-and-ink palette. Use them for calls to action on portfolios, agency sites, blogs and product pages. No JavaScript is needed.

How it works

The demo section.hb-board contains a ul.hb-grid of li.hb-cell cards, one button per card with a code.hb-caption that names its modifier. The grid shows one column on phones, two from 520px and four from 900px.

Every button shares the base class .hb-btn, which sets the 2px border, typography and isolation: isolate. That keeps each decorative ::before layer (with z-index: -1) above the button background but below the label. All effects are triggered with :is(:hover, :focus-visible), so keyboard users see them too.

  • .hb-btn--fill-up: an ink layer scales up from the bottom with scaleY while the text turns light.
  • .hb-btn--fill-center: an accent layer grows outward from the center with scaleX.
  • .hb-btn--diagonal: a skewed accent panel slides in from the left over a dark button.
  • .hb-btn--slide: inside .hb-window (a one-line mask), .hb-slide moves up by 100%, so .hb-label leaves and .hb-label--clone takes its place while the background turns dark.
  • .hb-btn--draw: ::before draws the top and right edges, then ::after draws the bottom and left edges with staggered transition-delay values.
  • .hb-btn--arrow: the .hb-arrow SVG grows from zero width and fades in, pushing the label left.
  • .hb-btn--underline: a borderless button whose background-size grows a 3px accent underline.
  • .hb-btn--press: a hard offset box-shadow that shrinks on hover and disappears on :active.

Customization

  • --hb-ink and --hb-accent on .hb-board: the dark color and the orange highlight used by all fills.
  • --hb-speed and --hb-ease: duration and easing of every fill and slide animation.
  • --hb-paper and --hb-card: the page background and card background; --hb-paper is also the light text color on dark fills.
  • --hb-focus: color of the 3px keyboard focus outline.
  • min-width and padding in .hb-btn: make all buttons wider, narrower or taller.
  • Change skewX(-24deg) in .hb-btn--diagonal::before for a steeper or flatter edge.
  • Change the label text in both .hb-label spans of the slide button so the copy matches.

Use cases

  • Portfolio sites: calls to action use fill, slide or border-drawing effects to feel hand-crafted
  • Agency websites: square-cornered uppercase buttons give a bold editorial look with a warm palette
  • Blogs: a borderless underline button works as a subtle read-more link
  • Product pages: arrow and press effects add feedback and also run for keyboard users on focus

Accessibility

Native button and a elements keep standard keyboard and screen reader behavior. The duplicate label in the slide button and the arrow icon are aria-hidden, so names are read once. Focus shows a blue outline offset from the button in addition to the hover effect. Text and fill colors keep strong contrast in both states. Under prefers-reduced-motion: reduce all transitions are removed and the end states appear instantly.

Usage notes

Copy .hb-btn plus the modifiers you need; .hb-board, .hb-grid and .hb-cell are only for the demo. Move the custom properties to :root if you drop .hb-board.

Animated Hover Buttons at a glance

Framework
Pure CSS
Code
HTML, CSS
JavaScript
Not needed, CSS only
Dependencies
None
Layout
Responsive, works on mobile
Category
Button Styles
License
Free for personal and commercial use

Questions about this template

Can I use the Animated Hover Buttons code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

There is nothing to install. Paste the HTML where the component should appear and add the CSS to your stylesheet. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. It is built with HTML and CSS only, so there is no JavaScript to load.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

No dependencies. Pure HTML, CSS and JavaScript.

Animated Hover Buttons – free Pure CSS button style template
Animated Hover Buttons · free Pure CSS button style template

More Button Styles

Gradient Buttons – free Pure CSS button style template

Gradient Buttons

Pure CSS gradient buttons with shifting colors on hover, a gradient outline, glow and shine effects, sizes and a disabled state.

3D Pushable Buttons – free Tailwind CSS button style template

3D Pushable Buttons

Tailwind CSS 3D buttons with a raised edge that lift on hover and press down on click, with sizes, icon buttons and toggles.

Buttons with Loading State – free Bootstrap 5 button style template

Buttons with Loading State

Bootstrap 5 buttons that show a spinner, block repeat clicks while working and then display a success or error state, in solid, outline, pill and icon styles.

Button Variants – free Tailwind CSS button style template

Button Variants

Tailwind CSS button set with primary, secondary, outline, ghost, danger and link variants, five sizes, icon buttons, loading and disabled states.