Dev Helpers

CSS / Editorial details

Ruby pronunciation note

Dev Helpers · October 4, 2025

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

Related articles

Fluid width with a maximum

A fluid container needs a small-screen width and a large-screen maximum. Outer gutters should remain visible at both extremes.

Square aspect ratio

A square ratio reserves equal sides even before media loads. Fit rules decide whether rectangular content is cropped or letterboxed.