Location Maplist Hover
A location marker moves alongside the hovered address in an office directory.
A location marker moves alongside the hovered address in an office 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.
<div class="tbx-1262"><nav class="locations" aria-label="Store information"><span class="marker" aria-hidden="true">●</span><button type="button" class="place p1"><span>01</span> Central Studio <b>↗</b></button><button type="button" class="place p2"><span>02</span> Riverside Shop <b>↗</b></button><button type="button" class="place p3"><span>03</span> Parkside Office <b>↗</b></button></nav></div>
.tbx-1262{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-1262 *,.tbx-1262 *::before,.tbx-1262 *::after{box-sizing:border-box}
.tbx-1262{background:#e9e1d7}
.tbx-1262 .locations{width:min(300px,100%);position:relative;display:grid;gap:3px;padding:12px 8px 12px 25px;background:#fcfbf7;box-shadow:0 6px 20px #6e5d4e19;--y:0px}
.tbx-1262 .marker{position:absolute;top:28px;left:8px;line-height:1;color:#c26d4c;font-size:11px;transform:translateY(var(--y));transition:transform .38s cubic-bezier(.2,.8,.2,1);pointer-events:none}
.tbx-1262 .place{border:0;background:transparent;cursor:pointer;color:#303b3e;text-align:left;display:flex;align-items:center;gap:10px;font-size:14px;padding:8px 5px;min-height:38px;transition:color .3s,background .3s}
.tbx-1262 .place span{font-size:9px;color:#ad9383}
.tbx-1262 .place b{margin-left:auto;font-size:16px;font-weight:400;opacity:.3;transition:opacity .3s}
.tbx-1262 .place:is(:hover,:focus-visible){color:#9d4d35;background:#f3ebe3}
.tbx-1262 .place:is(:hover,:focus-visible) b{opacity:1}
.tbx-1262 .locations:has(.p1:hover),.tbx-1262 .locations:has(.p1:focus-visible){--y:0px}
.tbx-1262 .locations:has(.p2:hover),.tbx-1262 .locations:has(.p2:focus-visible){--y:41px}
.tbx-1262 .locations:has(.p3:hover),.tbx-1262 .locations:has(.p3:focus-visible){--y:82px}
@media (prefers-reduced-motion: reduce) {.tbx-1262 *, .tbx-1262 *::before, .tbx-1262 *::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 access sections and 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.