Inline Glossary Rail
A glossary definition slides into the margin beside a technical term.
A glossary definition slides into the margin beside a technical term.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
<a class="tbx-1148" href="#glossary"><span class="tbx-1148__term">Core Web Vitals <span aria-hidden="true">↗</span></span><span class="tbx-1148__definition">Page experience metrics</span></a>
.tbx-1148{box-sizing:border-box;position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:8px;width:min(314px,100%);padding:21px 12px;border-bottom:2px solid #98b0c5;color:#23435b;font-family:system-ui,sans-serif;text-decoration:none;overflow:hidden;min-height:100px}
.tbx-1148__term{font-size:17px;font-weight:800;white-space:nowrap;transition:color .28s}.tbx-1148__term span{font-size:14px;color:#6686a0}
.tbx-1148__definition{position:relative;display:inline-flex;align-items:center;min-height:26px;padding:4px 10px;border-radius:5px;background:#dceaf5;color:#355672;font-size:11px;font-weight:700;opacity:0;transform:translateX(-16px);transition:transform .38s cubic-bezier(.2,.75,.2,1),opacity .34s;pointer-events:none}
.tbx-1148:is(:hover,:focus-visible) .tbx-1148__definition{opacity:1;transform:translateX(0)}.tbx-1148:is(:hover,:focus-visible) .tbx-1148__term{color:#176e9c}
.tbx-1148:focus-visible{outline:3px solid #5f91b5;outline-offset:3px}
@media (prefers-reduced-motion: reduce) { .tbx-1148, .tbx-1148 *, .tbx-1148::before, .tbx-1148::after, .tbx-1148 *::before, .tbx-1148 *::after { animation-duration:.01ms !important;transition-duration:.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 documentation sections and learning websites.
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.