HTML Tutorial

HTML Tag: <rt>

<rt> is used in conjunction with <ruby> and <rp> tags to create a ruby annotation. It provides a pronunciation or phonetic transcription of the preceding text.

Usage of <rt>:

  • Place the <rt> tag immediately after the text that needs annotation.
  • The pronunciation or transcription should be placed inside the <rt> tag.
  • Always use <rt> in combination with <ruby> and <rp> tags.

Attributes of <rt>:

  • None

Examples with <rt>:

Example 1:

<ruby>
  <rb>健康</rb>
  <rt>けんこう</rt>
</ruby>

Output:

健康 (pronounced as けんこう)

Example 2:

<ruby>
  <rp>汉字</rp>
  <rt>かんじ</rt>
</ruby>

Output:

汉字 (read as かんじ)

Exploring the <rt> Tag:

<!DOCTYPE html>
<html>
<head>
  <title>Exploring the <rt> Tag</title>
</head>
<body>
  <h1>Ruby Annotation</h1>
  <ruby>
    <rb>日本語</rb>
    <rt>にほんご</rt>
  </ruby>
</body>
</html>

Output:

日本語 (にほんご)

This example demonstrates how the <rt> tag can be used to provide a pronunciation guide for the Japanese word "日本語".