{"id":87,"date":"2022-12-23T16:00:54","date_gmt":"2022-12-23T16:00:54","guid":{"rendered":"https:\/\/www.joyokanjikai.com\/learning-japanese\/?p=87"},"modified":"2024-07-04T18:06:46","modified_gmt":"2024-07-04T18:06:46","slug":"how-to-write-furigana-in-html","status":"publish","type":"post","link":"https:\/\/www.joyokanjikai.com\/learning-japanese\/how-to-write-furigana-in-html\/","title":{"rendered":"How to Write\/Add Furigana in HTML? (Answered)"},"content":{"rendered":"\n<p class=\"has-link-color wp-elements-67b1dd8c5b2e972c5ac38cba6bcdc848\" style=\"font-size:23px\">To write <a href=\"https:\/\/www.joyokanjikai.com\/learning-japanese\/what-are-furigana\/\" title=\"\">furigana (\u632f\u308a\u4eee\u540d)<\/a> in HTML, you can use the <code>&lt;ruby&gt;<\/code> element, which is a part of the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTML\/Element\/ruby\" target=\"_blank\" rel=\"noopener\" title=\"\">HTML Ruby Extension<\/a>. The <code>&lt;ruby&gt;<\/code> element is used to mark up ruby text, which is a type of small, annotated text that is used to provide pronunciation or other information about a character or word.<\/p>\n\n\n\n<p>Here&#8217;s an example of how you can use the <code>&lt;ruby&gt;<\/code> element to write furigana in HTML:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;ruby&gt;\n  \u8aad&lt;rt&gt;\u3088&lt;\/rt&gt;\u3080\n&lt;\/ruby&gt;<\/code><\/pre>\n\n\n\n<p>Which looks like this:<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<ruby>\n  \u8aad<rt>\u3088<\/rt>\u3080\n<\/ruby>\n<\/div>\n<\/div>\n\n\n\n<p>(meaning \u201cto read\u201d, pronounced in English as \u201cyomu\u201d).<\/p>\n\n\n\n<p>In this example, the kanji character &#8220;\u8aad&#8221; is surrounded by the <code>&lt;ruby&gt;<\/code> element, and the pronunciation of the character (written in hiragana as &#8220;\u3088&#8221;) is marked up with the <code>&lt;rt&gt;<\/code> (ruby text) element. The resulting furigana will then be displayed above the kanji character.<\/p>\n\n\n\n<p>Note that the <code>&lt;ruby&gt;<\/code> element is not supported in all web browsers, so you may want to include a fallback solution in your HTML code in case the <code>&lt;ruby&gt;<\/code> element is not supported by the user&#8217;s browser. One way to do this is to use the <code>&lt;ruby&gt;<\/code> element in combination with the <code>&lt;rp&gt;<\/code> (ruby parenthesis) element, which can be used to provide a fallback for browsers that do not support ruby text. Here&#8217;s an example of how you can use the <code>&lt;rp&gt;<\/code> element to provide a fallback for the <code>&lt;ruby&gt;<\/code> element:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;ruby&gt;\n  \u8aad&lt;rp&gt;(&lt;\/rp&gt;&lt;rt&gt;\u3088&lt;\/rt&gt;&lt;rp&gt;)&lt;\/rp&gt;\u3080\n&lt;\/ruby&gt;<\/code><\/pre>\n\n\n\n<p>Which (once again) looks like this:<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<ruby>\n  \u8aad<rp>(<\/rp><rt>\u3088<\/rt><rp>)<\/rp>\u3080\n<\/ruby>\n<\/div>\n<\/div>\n\n\n\n<p>In this example, the <code>&lt;rp&gt;<\/code> elements are used to enclose the <code>&lt;rt&gt;<\/code> element in parentheses, which can be used as a fallback for browsers that do not support the <code>&lt;ruby&gt;<\/code> element. The resulting text will be displayed as &#8220;\u8aad(\u3088)\u3080&#8221; in browsers that do not support the <code>&lt;ruby&gt;<\/code> element.<\/p>\n\n\n\n<p>Easy!<\/p>\n\n\n\n<p class=\"has-link-color has-small-font-size wp-elements-32725438cd4b421f19b616f3ee35e470\">Note: for those wondering how to write Furigana within a WordPress blog post or page, <a href=\"https:\/\/www.joyokanjikai.com\/learning-japanese\/how-to-write-furigana-in-wordpress-answered\/\" title=\"\">check out this other post of ours!<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To write furigana (\u632f\u308a\u4eee\u540d) in HTML, you can use the &lt;ruby&gt; element, which is a part of the HTML Ruby Extension. The &lt;ruby&gt; element is used to mark up ruby text, which is a type of small, annotated text that is used to provide pronunciation or other information about a character or word. Here&#8217;s an [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[16,23],"tags":[21,20,24],"class_list":["post-87","post","type-post","status-publish","format-standard","hentry","category-kanji","category-katakana","tag-furigana","tag-html","tag-kana"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.joyokanjikai.com\/learning-japanese\/wp-json\/wp\/v2\/posts\/87","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.joyokanjikai.com\/learning-japanese\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joyokanjikai.com\/learning-japanese\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joyokanjikai.com\/learning-japanese\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joyokanjikai.com\/learning-japanese\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":18,"href":"https:\/\/www.joyokanjikai.com\/learning-japanese\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":1193,"href":"https:\/\/www.joyokanjikai.com\/learning-japanese\/wp-json\/wp\/v2\/posts\/87\/revisions\/1193"}],"wp:attachment":[{"href":"https:\/\/www.joyokanjikai.com\/learning-japanese\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joyokanjikai.com\/learning-japanese\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joyokanjikai.com\/learning-japanese\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}