Center Underline Expand
An underline grows from the center toward both ends of a navigation link.
An underline grows from the center toward both ends of a navigation link.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
<button class="tbx-1016" type="button">About us</button>
.tbx-1016{position:relative;padding:12px 6px 14px;border:0;background:transparent;color:#203951;font:650 15px/1.4 system-ui,sans-serif;cursor:pointer}
.tbx-1016::after{content:"";position:absolute;left:50%;right:50%;bottom:5px;height:2px;background:#2c94a4;transition:left .27s ease,right .27s ease}
.tbx-1016:is(:hover,:focus-visible)::after{left:6px;right:6px}
.tbx-1016:focus-visible{outline:3px solid #7b65db;outline-offset:3px;border-radius:2px}
@media(prefers-reduced-motion:reduce){.tbx-1016::after{transition:none}}
How to Use
Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.
Use Case
Useful for navigation menus.
Technical Notes
Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.
Mobile: Ensure the interactive content remains accessible without hover on touch devices.
Browser: Uses modern CSS. Check behavior in the browsers you support.
Reduced Motion: Check that prefers-reduced-motion is respected.