HTML HTML Tutorial HTML Forms HTML Graphics HTML Media HTML APIs HTML Tags



HTML Tag: rt

The <rt> tag is used to define the pronunciation of characters in a ruby annotation. Ruby annotations are small text annotations that are used to provide pronunciation or translation information for East Asian languages such as Chinese, Japanese, and Korean.

The <rt> tag is always used in conjunction with the <ruby> tag, which is used to define the ruby text. The ruby text is the text that is being annotated. The <rt> tag is used to define the pronunciation of the ruby text.

Here is an example of how the <rt> tag can be used:

<ruby>
  漢 <rt>かん</rt>
  字 <rt>じ</rt>
</ruby>

In this example, the ruby text is "漢字", which means "Chinese characters". The <rt> tags are used to provide the pronunciation of the characters. The first character is pronounced "kan" and the second character is pronounced "ji".

Here is another example:

<ruby>
  你好 <rt>nǐ hǎo</rt>
</ruby>

In this example, the ruby text is "你好", which means "hello" in Chinese. The <rt> tag is used to provide the pronunciation of the characters. The pronunciation is "nǐ hǎo".

The <rt> tag is a relatively new addition to HTML, and it is not yet widely supported by all browsers. However, it is supported by most modern browsers, including Chrome, Firefox, and Safari.

Here is a list of some of the browsers that support the <rt> tag:

  • Chrome
  • Firefox
  • Safari
  • Opera
  • Edge

It is important to note that the <rt> tag should only be used for East Asian languages that use ruby annotations. Using the <rt> tag for other languages or purposes is not recommended.

Overall, the <rt> tag is a useful addition to HTML for providing pronunciation and translation information for East Asian languages. While it is not yet widely supported by all browsers, it is supported by most modern browsers and is a valuable tool for web developers working with East Asian languages.

Code Examples

Here are some code examples that demonstrate how to use the <rt> tag:

Example 1

<ruby>
  漢 <rt>かん</rt>
  字 <rt>じ</rt>
</ruby>

Example 2

<ruby>
  你好 <rt>nǐ hǎo</rt>
</ruby>

Example 3

<ruby>
  한 <rt>han</rt>
  글 <rt>geul</rt>
</ruby>

Example 4

<ruby>
  日 <rt>に</rt>
  本 <rt>ほん</rt>
</ruby>

Example 5

<ruby>
  中 <rt>zhōng</rt>
  文 <rt>wén</rt>
</ruby>

References

Activity