TipsBlocks Web Technique Library

PRACTICAL WEB TIP

← Back to library

Baseline Echo Headline

A smaller echo of the headline appears beneath its baseline as a background line moves.

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
<div class="tbx-1256"><button type="button" class="word" aria-label="Explore selected work"><span class="headline">Selected Work<span class="aster">✳</span></span><span class="sub">EXPLORE / SELECTED PROJECTS</span><span class="baseline" aria-hidden="true"></span></button></div>
CSS
.tbx-1256{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;max-width:100%;min-height:218px;overflow:visible;padding:24px 18px;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#243e43}
.tbx-1256 *,.tbx-1256 *::before,.tbx-1256 *::after{box-sizing:border-box}
.tbx-1256{background:#e8edf0}
.tbx-1256 .word{border:0;background:transparent;text-align:left;color:#1e2b38;width:min(308px,100%);cursor:pointer;padding:20px 3px 28px;position:relative;overflow:hidden;font-family:inherit}
.tbx-1256 .headline{white-space:nowrap;display:block;font-family:Georgia,serif;font-size:clamp(25px,7vw,36px);letter-spacing:-.06em;line-height:1.15}
.tbx-1256 .aster{display:inline-block;color:#d2704b;font-family:system-ui;font-size:19px;transform:translate(4px,-7px);transition:transform .45s}
.tbx-1256 .sub{display:block;font-size:8px;font-weight:800;letter-spacing:.19em;max-height:0;opacity:0;transform:translateY(-7px);transition:max-height .38s,opacity .38s,transform .38s}
.tbx-1256 .baseline{position:absolute;bottom:16px;left:0;width:100%;height:2px;background:#94a0a5}
.tbx-1256 .baseline:after{content:"";position:absolute;inset:0;background:#d2704b;transform:translateX(-101%);transition:transform .52s}
.tbx-1256 .word:is(:hover,:focus-visible) .sub{max-height:24px;margin-top:8px;opacity:1;transform:none}
.tbx-1256 .word:is(:hover,:focus-visible) .baseline:after{transform:none}
.tbx-1256 .word:is(:hover,:focus-visible) .aster{transform:translate(5px,-7px) rotate(70deg)}
@media (prefers-reduced-motion: reduce) {.tbx-1256 *, .tbx-1256 *::before, .tbx-1256 *::after { transition-duration:0.01ms !important; animation-duration:0.01ms !important; scroll-behavior:auto !important; } }

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 hero sections and typography sections.

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.