Ruby markup associates a short annotation with base text. CSS controls its arrangement while the HTML retains the reading relationship.
Worked example
<style>
.demo {
ruby-position: over;
font-size: 2rem;
}
</style>
<ruby class="demo">山<rt>やま</rt></ruby>Implementation notes
Annotations need enough separation from adjacent lines. Increase the base line spacing if the pronunciation note collides with content above it.
Try it yourself
Increase the annotation length and test whether adjacent labels collide.
Open the CSS example →Editorial date October 4, 2025 · Published December 6, 2026