{"id":1658,"date":"2010-10-29T00:17:18","date_gmt":"2010-10-29T04:17:18","guid":{"rendered":"http:\/\/www.useragentman.com\/blog\/?p=1658"},"modified":"2015-05-18T12:43:48","modified_gmt":"2015-05-18T16:43:48","slug":"cross-browser-html5-ruby-annotations-using-css","status":"publish","type":"post","link":"http:\/\/www.useragentman.com\/blog\/2010\/10\/29\/cross-browser-html5-ruby-annotations-using-css\/","title":{"rendered":"Cross Browser HTML5 Ruby Annotations Using CSS"},"content":{"rendered":"<div id=\"attachment_1735\" class=\"wp-caption alignright\" style=\"width: 419px\"><a href=\"http:\/\/www.flickr.com\/photos\/eliazar\/3193967863\/\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/rubyExample.jpg\" alt=\"An example of ruby text, from a photo by Flickr user eliazar\" title=\"screenshot\" width=\"409\" height=\"261\" class=\"size-full wp-image-1619\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">An example of ruby text, from <a href=\"http:\/\/www.flickr.com\/photos\/eliazar\/3193967863\/\">a photo<\/a> by Flickr user <a href=\"http:\/\/www.flickr.com\/photos\/eliazar\/\">eliazar<\/a>.&#8221;<\/p>\n<\/div>\n<p>When talking about <strong>Ruby Annotations<\/strong>, I don&#8217;t mean Ruby on Rails, or anything related to the Ruby programming language.  I am talking about <a href=\"http:\/\/en.wikipedia.org\/wiki\/Ruby_character\"><strong>ruby characters<\/strong><\/a> which <strong>are used to annotate text with supplementary information.<\/strong>  For example if some readers wouldn&#8217;t know what the term &#8220;WWW&#8221; means, we can use ruby annotations to help them out like this:<\/p>\n<div class=\"rubyExample\">\n  I love the <ruby><rb>WWW<\/rb><rp> \uff08<\/rp><rt class=\"small\" style=\"font-size: 0.37em\">World Wide Web<\/rt><rp>\uff09 <\/rp><\/ruby>.\n<\/div>\n<p>The <strong>ruby base<\/strong> (in this case &#8220;WWW&#8221;) is annotated by <strong>ruby text<\/strong> (&#8220;World Wide Web&#8221;).  In this case, the ruby text appears in a small font-size above the base.  Traditionally, ruby annotations have been used in Chinese, Korean and Japanese text-books to help students of those languages sound out more complicated characters:<\/p>\n<div class=\"rubyExample japanese\">\n  <ruby><rb>\u6771\u4eac<\/rb><rp> \uff08<\/rp><rt>\u3068\u3046\u304d\u3087\u3046<\/rt><rp>\uff09 <\/rp><\/ruby>\u306b<ruby><rb>\u884c<\/rb><rp> \uff08<\/rp><rt>\u3044<\/rt><rp>\uff09 <\/rp><\/ruby>\u304d\u305f\u3044\u3002\n<\/div>\n<p>In the text above, the <strong>ruby base is written in Kanji<\/strong>, many of which are only readable by Japanese with a high-school education. The <strong>ruby text is written in Hiragana<\/strong>, which all Japanese grade-schoolers can understand. <\/p>\n<p>I can hear you saying to yourself <strong>&#8220;Who cares?  I&#8217;m not Japanese!  I can&#8217;t read any of it!&#8221;<\/strong>. Ruby annotations can also be used to help those who don&#8217;t speak the language at all.  An author can use ruby to help English speakers  pronounce Japanese &#8230; <\/p>\n<div class=\"rubyExample japanese\">\n  <ruby><rb>\u6771\u4eac<\/rb><rp> (<\/rp><rt><span class=\"romaji\">t\u014d ky\u014d<\/span><\/rt><rp>) <\/rp><\/ruby> <ruby>\u306b<rp> (<\/rp><rt><span class=\"romaji\">ni<\/span><\/rt><rp>) <\/rp><\/ruby><ruby>\u884c\u304d<rp> (<\/rp><rt><span class=\"romaji\">iki<\/span><\/rt><rp>) <\/rp><\/ruby><ruby>\u305f\u3044<rp> (<\/rp><rt><span class=\"romaji\">tai<\/span><\/rt><rp>) <\/rp><\/ruby>\u3002\n<\/div>\n<p>.. or, for that matter, any other language, like Ukrainian.<\/p>\n<div class=\"rubyExample\">\n<ruby><rb>\u0417\u043e\u043b\u0442\u0430\u043d <\/rb><rp> (<\/rp><rt>zol-tan<\/rt><rp>)<\/rp><\/ruby> <ruby><rb>\u0404\u0432\u0433\u0435\u043d\u043e\u0432\u0438\u0447 <\/rb><rp> (<\/rp><rt>yew-hen-o-vich<\/rt><rp>)<\/rp><\/ruby> <ruby><rb>\u0413\u0430\u0432\u0440\u0438\u043b\u044e\u043a <\/rb><rp> (<\/rp><rt>how-real-luke<\/rt><rp>)<\/rp><\/ruby>.\n<\/div>\n<p>It can also allow an author to give translations on top of foreign words.<\/p>\n<div class=\"rubyExample japanese\">\n  <ruby><rb>\u6771\u4eac \u306b \u884c\u304d \u305f\u3044<\/rb><rp> (<\/rp><rt><span class=\"romaji\">I want to go to Tokyo.<\/span><\/rt><rp>) <\/rp><\/ruby>\u3002\n<\/div>\n<h2>But I Have a Hard Enough Time With English!<\/h2>\n<p>Ruby text can also be used for help foreign students pronounce English words that may difficult to read:<\/p>\n<div class=\"rubyExample\">\nHis <ruby><rb>communication <\/rb><rp> (<\/rp><rt class=\"phonetic\">k&#601;-my<span class=\"long\">oo<\/span>-n&#301;-<strong>k&#257;&#180;<\/strong>-sh&#601;n<\/rt><rp>) <\/rp><\/ruby> skills are quite bad.\n<\/div>\n<p>It can be also be used to help English speakers read intimidating Eastern European surnames transliterated into English:<\/p>\n<div class=\"rubyExample\">\nMy name is Zoltan <ruby><rb>Hawryluk<\/rb><rp> (pronounced: <\/rp><rt>how-real-luke<\/rt><rp>)<\/rp><\/ruby>.\n<\/div>\n<p>(<strong>An aside note to telemarketers:<\/strong> if you call my home and ask my to speak to &#8220;Mister Have &#8212;- um &#8212; uk&#8221; , &#8220;Mister Hawww &#8212; ahh &#8212; uhhh&#8221; <strong><em>or especially &#8220;Mr. Zoltar&#8221;<\/em><\/strong>, I will hang up immediately.  If you actually pronounce my name correctly, I&#8217;ll give you at least five minutes of my time.  I mean it.)<\/p>\n<h2>Okay, how is this coded?<\/h2>\n<p>Let&#8217;s take a look at the markup of the above example:<\/p>\n<blockquote class=\"code\">\n<pre>\r\nMy name is Zoltan\r\n&lt;ruby&gt;\r\n   &lt;rb&gt;Hawryluk&lt;\/rb&gt;\r\n   &lt;rp&gt; (&lt;\/rp&gt;\r\n   &lt;rt&gt;how-real-luke&lt;\/rt&gt;\r\n   &lt;rp&gt;) &lt;\/rp&gt;\r\n&lt;\/ruby&gt; \r\n<\/pre>\n<\/blockquote>\n<p>Let&#8217;s break down what each of these tags do:<\/p>\n<table class=\"dataTable\">\n<thead>\n<tr>\n<th>Tag<\/th>\n<th>Name<\/th>\n<th>Function<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n<code>&lt;ruby&gt;<\/code>\n<\/td>\n<td>Ruby Tag<\/td>\n<td>Used to specify a Ruby Annotation.<\/td>\n<\/tr>\n<tr>\n<td>\n<code>&lt;rb&gt;<\/code>\n<\/td>\n<td>Ruby Base Tag<\/td>\n<td>Used to specify the text that is to be annotated.<\/td>\n<\/tr>\n<tr>\n<td><code>&lt;rt&gt;<\/code><\/td>\n<td>Ruby Text<\/td>\n<td>The actual ruby text, which contains the actual annotation.  By default, it appears above the actual text.<\/td>\n<\/tr>\n<tr>\n<td><code>&lt;rp&gt;<\/code><\/td>\n<td>Ruby Parenthesis<\/td>\n<td>These are displayed to browsers that cannot display ruby text, and permits graceful degradation.  It also allows the text to be copied and pasted into another document without the formatting.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>To illustrate the last point about the <code>&lt;rp&gt;<\/code> tag, copy and paste the following ruby text into notepad, vi or any other plain text editor:<\/p>\n<div class=\"rubyExample\">\nMy name is Zoltan <ruby><rb>Hawryluk<\/rb><rp> (pronounced: <\/rp><rt>how-real-luke<\/rt><rp>)<\/rp><\/ruby>.\n<\/div>\n<p>You will see the following in your text editor:<\/p>\n<blockquote class=\"code\">\n<pre>\r\nMy name is Zoltan Hawryluk (pronounced: how-real-luke).\r\n<\/pre>\n<\/blockquote>\n<p>This is because the of how the <code>&lt;rp&gt;<\/code> tags are defined:<\/p>\n<blockquote class=\"code\">\n<pre>\r\nMy name is Zoltan &lt;ruby&gt;&lt;rb&gt;Hawryluk&lt;\/rb&gt;<span class=\"hilite\">&lt;rp&gt; (pronounced: &lt;\/rp&gt;<\/span>&lt;rt&gt;how-real-luke&lt;\/rt&gt;<span class=\"hilite\">&lt;rp&gt;)&lt;\/rp&gt;<\/span>\r\n<\/pre>\n<\/blockquote>\n<h2>Browser Support<\/h2>\n<p>So what browsers support these tags?  Originally, the <code>&lt;ruby&gt;<\/code> tag was a proprietary Microsoft tag that worked in IE 5+.  Since then it has become a part of HTML5 and WebKit based browsers like Safari and Chrome now support it as well.  In order for Firefox and Opera to join the party, I <a href=\"https:\/\/www.useragentman.com\/shared\/css\/ruby\/screen.css\">remixed a stylesheet<\/a> developed for <a href=\"http:\/\/www.princexml.com\/bb\/viewtopic.php?t=81\">Prince XML<\/a> by <a href=\"http:\/\/www.chavchanidze.com\/\">George Chavchanidze<\/a> of Opera Software.  Below are some screenshots of how the ruby text looks in the various browsers with or without the stylesheet.<\/p>\n<table class=\"dataTable\">\n<thead>\n<tr>\n<th><\/th>\n<th>With stylesheet set<\/th>\n<th>Without stylesheet set<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>IE 6.0+<\/th>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/example-IE-with.png\" alt=\"example screenshot with IE with stylesheet set\"  \/><\/td>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/example-IE-without.png\" alt=\"example screenshot with IE with stylesheet set\"   \/><\/td>\n<\/tr>\n<tr>\n<th>Firefox 3.6+<\/th>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/example-Firefox-with.png\" alt=\"example screenshot with Firefox with stylesheet set\" title=\"example-IE-without\"  \/><\/td>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/example-Firefox-without.png\" alt=\"example screenshot with Firefox with stylesheet set\"   \/><\/td>\n<\/tr>\n<tr>\n<th>Safari 5.0+<\/th>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/example-safari-with.png\" alt=\"example screenshot with Safari with stylesheet set\"   \/><\/td>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/example-safari-without.png\" alt=\"example screenshot with Safari with stylesheet set\"  \/><\/td>\n<\/tr>\n<tr>\n<th>Chrome 7.0+<\/th>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/example-chrome-with.png\" alt=\"example screenshot with Chrome with stylesheet set\" title=\"example-IE-without\"  \/><\/td>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/example-chrome-without.png\" alt=\"example screenshot with Chrome with stylesheet set\" title=\"example-IE-without\"  \/><\/td>\n<\/tr>\n<tr>\n<th>Opera 10.63+<\/th>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/example-opera-with.png\" alt=\"example screenshot with Opera with stylesheet set\"  \/><\/td>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/example-opera-without.png\" alt=\"example screenshot with Opera with stylesheet set\"  \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a class=\"exampleLink\" href=\"https:\/\/www.useragentman.com\/shared\/css\/ruby\/screen.css\">Download the stylesheet used in the examples on this page<\/a><\/p>\n<p>I took George&#8217;s <strong>excellent<\/strong> work and added a few additional features:<\/p>\n<ul>\n<li>It tells IE to ignore the Firefox and Opera styles (since they don&#8217;t look so good in IE)<\/li>\n<li>It makes the font size smaller in Chrome and Safari (a personal preference).<\/li>\n<li>It sets the <code>&lt;ruby&gt;<\/code> tag&#8217;s <code>ruby-align<\/code> CSS property to <code>center<\/code>, so that IE mimics the way the WebKit browser display ruby text by default (IE&#8217;s default seems to be <code>distribute-letter<\/code>, which looks horrible in a lot of situations).<\/li>\n<\/ul>\n<p>Also note that without the stylesheet, the ruby text gracefully degrades in Firefox and Opera, so it is still readable, and illustrates the usefulness of the <code>&lt;rp&gt;<\/code> tags.  This stylesheet occasionally cause some unusual rendering in some older browsers (such as Safari 4.0 for Mac), but on the whole it does a pretty good job.<\/p>\n<p>Note that in order to make the stylesheet set to work correctly, you must replace the <code>&lt;body&gt;<\/code> tag with this variation of <a href=\"http:\/\/paulirish.com\/2008\/conditional-stylesheets-vs-css-hacks-answer-neither\/\">Paul Irish&#8217;s Conditional CSS design pattern<\/a>:<\/p>\n<blockquote class=\"code\">\n<pre>\r\n&lt;!--[if lt IE 7 ]&gt; &lt;body class=\"ie6\"&gt; &lt;![endif]--&gt;\r\n&lt;!--[if IE 7 ]&gt;    &lt;body class=\"ie7\"&gt; &lt;![endif]--&gt;\r\n&lt;!--[if IE 8 ]&gt;    &lt;body class=\"ie8\"&gt; &lt;![endif]--&gt;\r\n&lt;!--[if IE 9 ]&gt;    &lt;body class=\"ie9\"&gt; &lt;![endif]--&gt;\r\n&lt;!--[if (gt IE 9)]&gt;&lt;body class=\"modern\"&gt; &lt;![endif]--&gt;\r\n&lt;!--[!(IE)]&gt;&lt;!--&gt;  &lt;body class=\"notIE modern\"&gt; &lt;!--&lt;![endif]--&gt;\r\n<\/pre>\n<\/blockquote>\n<p>Using this declaration of the <code>&lt;body&gt;<\/code> blocks the Firefox and Opera styles in IE.<\/p>\n<h2>Advanced Ruby Annotations<\/h2>\n<p>Using the stylesheet, it is possible to also <strong>break ruby text into parts (e.g. syllables) without using a separate <code>&lt;ruby&gt;<\/code> tag for each part<\/strong>.  This is done with the <code>&lt;rbc&gt;<\/code> (ruby base container) and <code>&lt;rtc&gt;<\/code> (ruby text container).  Here is an example:<\/p>\n<div class=\"rubyExample\">\nHis <ruby class=\"syllables unicodeRubyText\"><rbc><rb>com<\/rb><rb>mu<\/rb><rb>ni<\/rb><rb>ca<\/rb><rb>tion <\/rb><\/rbc><rp> (<\/rp><rtc><rt >k&#601;m<\/rt><rt>myoo<\/rt><rt>n&#301;<\/rt><rt><strong>k&#257;&#180;<\/strong><\/rt><rt  >sh&#601;n<\/rt><\/rtc><rp>) <\/rp><\/ruby> skills are quite bad.\n<\/div>\n<p>Although Internet Explorer does not understand these new tags, it does degrade gracefully.  Here is a comparison of how IE renders the above and how Firefox does.<\/p>\n<table class=\"dataTable\">\n<thead>\n<tr>\n<th>Firefox 3.6<\/th>\n<th>Internet Explorer 6+<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"width: 50%\"><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/containerFirefox.png\" alt=\"[Screenshot of rbc\/rtc tag example in Firefox]\"  \/><\/td>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/containerExplorer.png\" alt=\"[Screenshot of rbc\/rtc tag example in IE]\"  \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Here is the code that generated the example above.  <\/p>\n<blockquote class=\"code\">\n<pre>\r\n&lt;ruby class=\"syllables unicodeRubyText\"&gt;\r\n<span class=\"hilite\">  &lt;rbc&gt;\r\n    &lt;rb&gt;com&lt;\/rb&gt;&lt;rb&gt;mu&lt;\/rb&gt;&lt;rb&gt;ni&lt;\/rb&gt;&lt;rb&gt;ca&lt;\/rb&gt;&lt;rb&gt;tion &lt;\/rb&gt;\r\n  &lt;\/rbc&gt;<\/span>\r\n  &lt;rp&gt; (&lt;\/rp&gt;\r\n<span class=\"hilite\">  &lt;rtc&gt;\r\n    &lt;rt&gt;k&#601;m&lt;\/rt&gt;&lt;rt&gt;myoo&lt;\/rt&gt;&lt;rt&gt;n&#301;&lt;\/rt&gt;&lt;rt&gt;&lt;strong&gt;k&#257;&lt;\/strong&gt;&lt;\/rt&gt;&lt;rt&gt;sh&#601;n&lt;\/rt&gt;\r\n  &lt;\/rtc&gt;<\/span>\r\n  &lt;rp&gt;) &lt;\/rp&gt;\r\n&lt;\/ruby&gt; \r\n<\/pre>\n<\/blockquote>\n<p>Note that the <code>&lt;ruby&gt;<\/code> tag is a member of the classes <code>syllables<\/code> and <code>unicodeRubyText<\/code>, which are defined in the stylesheet.  The <code>syllables<\/code> class tells the browser to separate the ruby base text into syllables, separated by the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Middot\">&#8220;Interpunct&#8221;<\/a> symbol, while the <code>unicodeRubyText<\/code> tells the browser to render the ruby text with a Unicode font, so that the pronunciation symbols are printed correctly (it seems that this is only a requirement in Explorer, since the other browsers handle this automatically).<\/p>\n<p>Here is a rundown of these advanced tags:<\/p>\n<table class=\"dataTable\">\n<thead>\n<tr>\n<th>Tag<\/th>\n<th>Name<\/th>\n<th>Function<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n<code>&lt;rbc&gt;<\/code>\n<\/td>\n<td>Ruby Base Container<\/td>\n<td>Contains a list of <code>&lt;rb&gt;<\/code> tags.  This list is usually separated into syllables or some other logical order to make the text easier to read.<\/td>\n<\/tr>\n<tr>\n<td>\n<code>&lt;rtc&gt;<\/code>\n<\/td>\n<td>Ruby Text Container<\/td>\n<td>Contains a list of <code>&lt;rt&gt;<\/code> tags.  Each <code>&lt;rt&gt;<\/code> tag in this list corresponds to the respective <code>&lt;rb&gt;<\/code> tag in the <code>&lt;rtc&gt;<\/code> list.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/blockquote>\n<p>Unfortunately, there is a bug in older WebKit browsers that gives very strange results. Here are screen shots of the above code as viewed in Chrome 7.0 for Windows, with and without my stylesheet:<\/p>\n<table class=\"dataTable\">\n<thead>\n<tr>\n<th>Chrome 7.0 Windows (with stylesheet) <\/th>\n<th>Chrome 7.0 Windows (without stylesheet) <\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"width: 50%\"><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/containerChromeWithStylesheet.png\" alt=\"[Screenshot of rbc\/rtc tag example in Chrome 7.0 With My Stylesheet]\"  \/><\/td>\n<td><img decoding=\"async\" src=\"https:\/\/www.useragentman.com\/blog\/wp-content\/uploads\/2010\/10\/containerChromeWithoutStylesheet.png\" alt=\"[Screenshot of rbc\/rtc tag example in Chrome 7.0 Without My Stylesheet]\"  \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>This bug appears in Safari 4.x and lower and the current version of Chrome (7.0), for both Windows and Mac.  Since this has been fixed in Safari 5.0, I am assuming that this will be fixed in the next version of Chrome as well.<\/p>\n<h2>Ruby CSS3 Properties<\/h2>\n<p>There are three main CSS3 properties that can be used today &#8230; but in Internet Explorer only.  Here are a list of them, along with additional properties that the <a href=\"http:\/\/www.w3.org\/TR\/2001\/WD-css3-ruby-20010216\/\">W3C put in their recommendation back in 2001<\/a>.<\/p>\n<table class=\"dataTable\">\n<thead>\n<tr>\n<th>Property Name<\/th>\n<th>Description<\/th>\n<th>Support<\/th>\n<th>More Info<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>ruby-align<\/code><\/td>\n<td>Affects the horizontal alignment of the Ruby Text with respect to the ruby base.   Default value is <code>auto<\/code> (which is the same as <code>center<\/code>).  Other values are <code>left<\/code>, <code>right<\/code>, as well as <code>distribute-letter<\/code>, <code>distribute-space<\/code>, <code>line-edge<\/code>, <code>start<\/code> and <code>end<\/code>.<\/td>\n<td><code>left<\/code>, <code>right<\/code>, as well as <code>distribute-letter<\/code>, <code>distribute-space<\/code>, <code>line-edge<\/code> work in IE5+.<\/td>\n<td style=\"white-space: nowrap\">\n<ul>\n<li><a href=\"http:\/\/www.w3.org\/International\/articles\/ruby\/#Slide0210\">W3C Reference<\/a>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms531150%28VS.85%29.aspx\">MSDN<\/a><\/li>\n<li><a href=\"http:\/\/www.blooberry.com\/indexdot\/css\/properties\/intl\/ralign.htm\">Index  DOT  Css<\/a><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><code>ruby-overhang<\/code><\/td>\n<td>\nAffects how the ruby text will &#8220;hang&#8221; over the ruby base if the ruby-text is wider than the ruby-base.  Valid values are <code>auto<\/code>, <code>none<\/code>, <code>whitespace<\/code>, <code>start<\/code> and <code>end<\/code>.<\/td>\n<td><code>auto<\/code>, <code>none<\/code> and <code>whitespace<\/code> work in IE 5+<\/td>\n<td>\n<ul>\n<li><a href=\"http:\/\/www.w3.org\/International\/articles\/ruby\/#Slide0260\">W3C Reference<\/a>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms531151%28VS.85%29.aspx\">MSDN<\/a><\/li>\n<li><a href=\"http:\/\/www.blooberry.com\/indexdot\/css\/properties\/intl\/roverhang.htm\">Index  DOT  Css<\/a><\/li>\n<\/ul>\n<\/tr>\n<tr>\n<td><code>ruby-position<\/code><\/td>\n<td>Indicates where ruby text should appear relative to the base text.  Default is <code>before<\/code>. Other values are <code>after<\/code> (which makes it appear underneath the text), <code>inline<\/code>, <code>left<\/code> and <code>right<\/code>.<\/td\n\n\n<td>Only <code>above<\/code> and <code>inline<\/code> work in IE5+<\/td>\n<td>\n<ul>\n<li><a href=\"http:\/\/www.w3.org\/International\/articles\/ruby\/#Slide0180\">W3C Reference<\/a>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms531152(VS.85).aspx\">MSDN<\/a><\/li>\n<li><a href=\"http:\/\/www.blooberry.com\/indexdot\/css\/properties\/intl\/rposition.htm\">Index  DOT  Css<\/a><\/li>\n<\/ul>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Hopefully the other browsers will support these eventually.<\/p>\n<h2>And So, In Conclusion &#8230;<\/h2>\n<p>Here is a quick recap of the various things you should keep in mind when using Ruby Text:<\/p>\n<ul>\n<li>Firefox 3.6 and Opera 10.x need the stylesheet in order to show ruby text correctly.<\/li>\n<li>Recent versions of Safari and Chrome don&#8217;t need it, but using the stylesheet won&#8217;t harm the display of simple ruby text.<\/li>\n<li>IE doesn&#8217;t need the styleheet, but if you use the stylesheet to ensure cross-browser display of ruby text, you must use the special body tag declaration above.<\/li>\n<li><code>&lt;rbc&gt;<\/code> and <code>&lt;rtc&gt;<\/code> are not recognized in any version of IE, but they will degrade gracefully.<\/li>\n<li>Ruby text inside of <code>&lt;rtc&gt;<\/code> tags doesn&#8217;t look right in Chrome 7 or Safari 4.  Since they do show up right in Safari 5, I assume\/hope this will be fixed in the next version of Chrome.<\/li>\n<li>The advanced CSS3 <code>ruby-<\/code> properties, such as <code>ruby-align<\/code>, <code>ruby-overhang<\/code> and <code>ruby-position<\/code> are only supported by IE5+.<\/li>\n<\/ul>\n<h2>Additional Reading<\/h2>\n<ul>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ff460533%28v=VS.85%29.aspx\">[MS-RUBY]: Internet Explorer Ruby Annotation Standards Support Document<\/a> from the <a href=\"http:\/\/msdn.microsoft.com\/\">MSDN Web Site<\/a>.\n<li><a href=\"http:\/\/webkit.org\/blog\/948\/ruby-rendering-in-webkit\/\">Ruby Rendering in WebKit<\/a> from the <a href=\"http:\/\/webkit.org\/blog\/\">Surfin\u2019 Safari<\/a> Blog archive\n<li><a href=\"http:\/\/www.w3.org\/TR\/css3-ruby\/\">The W3C Recommendation document for Ruby Annotations<\/a>, dated 31 May 2001 with corrections made on 25 June 2008<\/a><\/li>\n<li><a href=\"http:\/\/www.w3.org\/TR\/2001\/WD-css3-ruby-20010216\/\">The W3C CSS3 Rub Module Working Draft<\/a> dated 14 May 2003.<\/a>.  There is also <a href=\"http:\/\/dev.w3.org\/csswg\/css3-ruby\/\">an editor&#8217;s copy<\/a> dated 04 March 2010.<\/li>\n<li><a href=\"http:\/\/princecss.com\/bb\/viewtopic.php?f=5&#038;t=81\">XHTML Ruby in Prince<\/a>, the forum thread where the original stylesheet was developerd.  Great to see as a reference.<\/li>\n<\/ul>\n<p><a class=\"exampleLink\" href=\"https:\/\/www.useragentman.com\/shared\/css\/ruby\/screen.css\">Download the stylesheet used in the examples on this page<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/2010\/10\/containerFirefox2.png\"  \/> Ruby Characters, although used originally to help people read complicated Chinese and Japanese characters, can also be used to annotate all types of information to written text.  This article shows how you can use it in browsers that support it, but also in ones that don&#8217;t using a simple stylesheet.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,38,8,35,77,119,76],"tags":[84,79,81,86,87,83,88,89,78,82,85,80,90,91,92,93,94],"class_list":["post-1658","post","type-post","status-publish","format-standard","hentry","category-css","category-css3","category-html","category-html5","category-internationalization","category-polyfills","category-ruby","tag-bopomofo","tag-chinese","tag-furigana","tag-hangul","tag-hanja","tag-hiragana","tag-i18n","tag-internationalization-2","tag-japanese","tag-kanji","tag-katakana","tag-korean","tag-multilanguage","tag-multilingual","tag-ruby-2","tag-xhtml","tag-xhtml-2-0"],"_links":{"self":[{"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/posts\/1658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/comments?post=1658"}],"version-history":[{"count":211,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/posts\/1658\/revisions"}],"predecessor-version":[{"id":6997,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/posts\/1658\/revisions\/6997"}],"wp:attachment":[{"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/media?parent=1658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/categories?post=1658"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.useragentman.com\/blog\/wp-json\/wp\/v2\/tags?post=1658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}