TipsBlocks Web Technique Library

PRACTICAL WEB TIP

← Back to library

Dotted Leader Directory

Dotted leaders expand between chapter titles and page numbers in a contents directory.

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
<nav class="tbx-1129" aria-label="Section contents"><a href="#intro"><b>01</b><span>Introduction</span><i aria-hidden="true"></i><em>02</em></a><a href="#method"><b>02</b><span>Our process</span><i aria-hidden="true"></i><em>08</em></a><a href="#works"><b>03</b><span>Case studies</span><i aria-hidden="true"></i><em>16</em></a></nav>
CSS
.tbx-1129{width:min(286px,100%);background:#fbfaf5;border:1px solid #e5e0d4;border-radius:5px;padding:12px 15px;font-family:system-ui,sans-serif}.tbx-1129 a{display:flex;align-items:center;gap:9px;min-height:51px;border-bottom:1px solid #ece8df;text-decoration:none;color:#324b49;font-size:12px;transition:padding .35s,color .35s}.tbx-1129 a:last-child{border-bottom:0}.tbx-1129 a b{font-size:10px;font-weight:850;color:#bc896d}.tbx-1129 a span{white-space:nowrap;font-weight:700}.tbx-1129 a i{flex:1;min-width:10px;height:3px;opacity:.15;transform:scaleX(0);transform-origin:left;background:radial-gradient(circle,#b97f60 1.5px,transparent 1.7px) left center/9px 3px repeat-x;transition:transform .42s,opacity .42s}.tbx-1129 a em{font-size:10px;font-style:normal;color:#8da49c}.tbx-1129 a:is(:hover,:focus-visible){padding-left:9px;color:#b46c4b}.tbx-1129 a:is(:hover,:focus-visible) i{opacity:1;transform:scaleX(1)}.tbx-1129 a:focus-visible{outline:2px solid #b97f60;outline-offset:-3px}@media(prefers-reduced-motion:reduce){.tbx-1129 *{transition:none!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 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.