Small pronunciation notes beside East Asian characters are often called ruby annotations. They belong to the text they explain, so their placement needs to follow the writing system rather than a fixed idea of the top of the screen.
HTML provides ruby for the annotated expression and rt for the annotation. CSS then controls aspects of presentation. MDN’s ruby-position reference explains that over places annotations above horizontal text but on the right side of vertical text. under similarly follows the opposite side of the writing direction.
Keep the relationship in the markup
<ruby class="reading">漢字<rt>かんじ</rt></ruby>
.reading {
ruby-position: over;
}The small text here is the reading for the base expression. It is not an absolutely positioned label that happens to sit nearby. That distinction becomes visible when the line wraps, the font changes or a reader enlarges the text.
For a comparison, place the same short expression in a horizontal paragraph and a separate container using writing-mode: vertical-rl. Keep the ruby declaration unchanged. Observe how the annotation follows the text direction. This is a useful test fixture, not a reason to force an entire page into vertical writing.
Review more than one short example
Try a longer annotation, mixed punctuation and neighbouring unannotated text. Check whether the line spacing remains comfortable and whether nearby ruby runs appear crowded. Then inspect the result in the browsers your audience uses; supported values and rendering details are not identical everywhere.
Do not replace meaningful readings with a tooltip that only appears on hover. A touch user or someone reading enlarged text needs the relationship to remain available too. For production copy, have a fluent reader check the annotations themselves: correct CSS cannot repair an incorrect pronunciation. Good ruby presentation keeps the reading attached, legible and aligned with the direction of the words.

