HTML and CSS Reference
In-Depth Information
By itself this does nothing, so you add the pronunciation either
for each character or, as in this case and our personal prefer-
ence, for the word as a whole. For this, you use the <rt> tag,
meaning ruby text.
<ruby> <rt> </rt></ruby>
Yo u c o u l d l e a v e i it l i k e it h a it a n d s u p p o r it i n g b r o w s e r s w o u l d s h o w
the hiragana pronunciation above the kanji text, but nonsupport-
ing browsers would ignore the tags and show both the text and
its pronunciation side by side. To solve this, you have another
tag, <rp> , meaning ruby parentheses, which cleverly hides
characters (namely parentheses) in supporting browsers. This
means you can write the pronunciation in parentheses, which
nonsupporting browsers will show, and supporting browsers will
continue to show the pronunciation without parentheses above
the main text ( Figure 2.20 ).
FIGURE 2.20 In supporting
browsers, ruby text is shown
above main text. In nonsupporting
browsers, ruby text is shown next
to main text but in parentheses.
At time of writing, the <ruby> element is discussed a lot in the
W3C HTML5 Japanese Interest group, so the spec is liable to
change based on that feedback.
Redefi ned elements
HTML5 redefi nes some existing elements as well as adding new
ones. Here are some old friends: some have radically changed,
others have simply fi nessed their hairstyles.
In HTML 4, the start attribute on <ol> was deprecated, as it
was deemed presentational. Luckily, HTML5 reverts this wrong
decision. If you want an ordered list to start at fi ve rather than
line one, use:
<ol start=5>
Search WWH ::

Custom Search