TipsBlocks Web Technique Library

PRACTICAL WEB TIP

← Back to library

Twin Tempo Underline

Two contrasting underlines arrive from opposite directions beneath a navigation or editorial 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.

HTML
<a class="tbx-1280" href="#stories"><span class="tbx-1280__label">OUR STORIES</span><span class="tbx-1280__n" aria-hidden="true">07</span></a>
CSS
.tbx-1280{display:inline-flex;align-items:center;gap:20px;position:relative;padding:15px 3px 16px;color:#342b4b;font:750 20px/1.4 system-ui,sans-serif;letter-spacing:.12em;text-decoration:none;max-width:100%}
.tbx-1280__n{color:#917cb7;font:700 11px/1 system-ui,sans-serif}
.tbx-1280::before,.tbx-1280::after{content:"";position:absolute;bottom:5px;width:50%;height:3px;transform:scaleX(0);transition:transform .42s cubic-bezier(.2,.8,.2,1)}
.tbx-1280::before{left:0;background:#a68ce0;transform-origin:right}
.tbx-1280::after{right:0;background:#e39b88;transform-origin:left;transition-delay:.06s}
.tbx-1280:hover::before,.tbx-1280:hover::after,.tbx-1280:focus-visible::before,.tbx-1280:focus-visible::after{transform:scaleX(1)}
.tbx-1280:focus-visible{outline:3px solid #a68ce0;outline-offset:2px}
@media(prefers-reduced-motion:reduce){.tbx-1280::before,.tbx-1280::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 and editorial layouts.

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.