← All elements
<button class="ace" type="button"><i></i><span>Learn more</span></button>About this button
A text button whose small arrow circle stretches into a full background on hover, keeping the label readable.
How it works
A small dark circle sits behind the left end of the label. On hover or focus its width grows to the full button, turning into a pill-shaped background, while the arrow drawn from two borders nudges forward and the label changes to white. Only width, position and colour are animated.
Ways to customise it
- Change #0f172a to your brand colour.
- Change the 190px width to suit a longer label.
- Edit the 0.45s timing curve.
Good to know
Keyboard focus triggers the same expansion as hover, so it is not a mouse-only effect. On touch screens the button works normally and the animation plays on tap.
Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.