Ruby annotation

루비 주석

Small pronunciation or gloss text placed alongside a base character or word — natively supported in HTML via the `<ruby>` element.

Also known as: 후리가나 표시Furigana<ruby> 태그
···
html
<div class="stage">
  <p class="line">
    <ruby class="r1">漢字<rt>한자</rt></ruby>
    <ruby class="r2">Design<rt>디자인</rt></ruby>
  </p>
  <div class="readout">&lt;ruby&gt;본문&lt;rt&gt;주석&lt;/rt&gt;&lt;/ruby&gt;</div>
</div>
css
.stage{display:grid;justify-items:center;gap:16px}
.line{margin:0;display:flex;gap:22px;font:700 clamp(18px,5.4vmin,30px)/1.4 -apple-system,system-ui,"Apple SD Gothic Neo",sans-serif;color:var(--fg)}
ruby{ruby-position:over;transition:color .5s}
rt{font:400 .38em/1 -apple-system,system-ui,sans-serif;color:var(--muted);transition:color .5s}
ruby.hl{color:var(--accent)}
ruby.hl rt{color:var(--accent-2)}
.readout{font:11px ui-monospace,Menlo,monospace;color:var(--muted);text-align:center}
js
const rubies = [document.querySelector('.r1'), document.querySelector('.r2')];
let i = 0;
function apply(){
  rubies.forEach(function(r){ r.classList.remove('hl'); });
  rubies[i % rubies.length].classList.add('hl');
  i++;
}
apply();
setInterval(apply, 1200);

Japanese furigana — small hiragana glosses placed above kanji to show pronunciation — is the best-known example, but glossing a difficult character or proper noun with its reading or meaning has a longer history across the Sinosphere. Korean text uses the same idea when it prints a loanword's original spelling or a term's gloss in small type next to it.

HTML has a dedicated element for this. Wrapping `<ruby>base<rt>annotation</rt></ruby>` tells the browser to automatically place the `<rt>` text small, above the base text (or beside it, in vertical writing) — with zero CSS required. It's one of the rare HTML tags whose default behavior is genuinely typographic.

The `<rp>` element wraps parenthesis fallback text ("base(annotation)") for very old browsers that don't understand ruby — largely unnecessary today. CSS `ruby-position` adjusts whether the annotation sits above or below, and `ruby-align` controls its alignment, though support varies by browser and is worth checking before relying on it.

When to use

Use it to attach a pronunciation or short gloss next to kanji, loanwords, or jargon — common in subtitles and educational content. For longer explanations, a tooltip or footnote fits better than `<rt>`.