PRACTICAL WEB TIP
Ruby Note Reveal
A short pronunciation or translation label appears above a headline for additional reading context.
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-1135" href="#concept"><span class="tbx-1135__ruby" aria-hidden="true">CONCEPT / 01</span><span class="tbx-1135__main">Designed for better living.</span><span class="tbx-1135__rule" aria-hidden="true"></span></a>
CSS
.tbx-1135{font-family:system-ui,sans-serif;position:relative;display:block;width:min(315px,100%);padding:22px 0 17px;text-decoration:none;color:#273d40}
.tbx-1135__ruby{position:absolute;top:3px;left:0;color:#9b615e;letter-spacing:.18em;font-size:10px;font-weight:800;opacity:0;transform:translateY(9px);transition:opacity .34s,transform .4s}
.tbx-1135__main{font-size:23px;font-weight:800;letter-spacing:.03em;line-height:1.6;transition:letter-spacing .45s}
.tbx-1135__rule{position:absolute;left:0;bottom:12px;right:0;height:1px;background:#c5d1cf;overflow:hidden}
.tbx-1135__rule:after{content:"";display:block;height:100%;width:100%;background:#a05e5e;transform:translateX(-100%);transition:transform .5s cubic-bezier(.2,.8,.2,1)}
.tbx-1135:is(:hover,:focus-visible) .tbx-1135__ruby{opacity:1;transform:translateY(0)}.tbx-1135:is(:hover,:focus-visible) .tbx-1135__main{letter-spacing:.07em}.tbx-1135:is(:hover,:focus-visible) .tbx-1135__rule:after{transform:translateX(0)}
.tbx-1135:focus-visible{outline:2px solid #a05e5e;outline-offset:5px}
@media (prefers-reduced-motion: reduce) { .tbx-1135, .tbx-1135 *, .tbx-1135::before, .tbx-1135::after, .tbx-1135 *::before, .tbx-1135 *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !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 editorial layouts 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.