HTML - <rt> Tag



The <rt> tag used to specify the ruby text explanation of a ruby annotation. It provides pronunciation, translation, or transliteration information for the writing systems of Chinese, Japanese, and Korean languages. This tag is new in HTML5. The <rt> tag must be enclosed within <ruby> and <rp> tag.

Syntax

Following is the syntax of <rt> tag −

<rt>.....</rt>

Example: Basic Usage

In the following example, we are creating an HTML document to demonstrate the working of the <rt> tag. When we run the code, it will display text in both English and Japanese on the webpage.

<!DOCTYPE html> <html> <head> <title>HTML rt tag</title> <style> rt { font-size: 25px; color: green; } </style> </head> <body> <h1>HTML rt Tag</h1> <ruby> <rt>tutorialspoint</rt> </ruby> </body> </html>

Example: Implementing Chinese Characters

In the following example, we use the <rt> tag to explain the Chinese words. Running the code will display text in both English and Chinese on the webpage. This HTML code demonstrates the <rt> tag, styling it green and large to provide pronunciation for the Chinese text.

<!DOCTYPE html> <html> <head> <title>HTML rt Tag</title> <style> rt { font-size: 25px; color: green; } </style> </head> <body> <h1>HTML rt Tag</h1> <ruby> <rt> tutorialspoint </rt> <rt> Easy to learn </rt> </ruby> </body> </html>

Example: Implementing Korean Characters

Let's look at the following example, where we use the <rt> tag to explain the Korean language. This HTML code demonstrates the <rt> tag, styling it green and large to provide pronunciation for the Korean text. Running the code will display text in both English and Korean on the webpage.

<!DOCTYPE html> <html> <head> <title>HTML rt Tag</title> <style> rt { font-size: 25px; color: green; } </style> </head> <body> <h1>HTML rt Tag</h1> <ruby> . <rt>This is korean language </rt> <rt>This is tutorialspoint </rt> </ruby> </body> </html>

Supported Browsers

Tag Chrome Edge Firefox Safari Opera
rt Yes 5.0 Yes 5.5 Yes 38.0 Yes 5.0 Yes 15.0
html_tags_reference.htm
Advertisements