rubyPosition style property
Specifies or returns the position of the Ruby text (rt).
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
CSS page for this property: ruby-position |
Possible values:
The type of this property is string.
One of the following values:
Default. The Ruby text (rt) is located above the base content. | |||||||
The Ruby text (rt) is located inline with the base content. |
Default: above.
Example HTML code 1:
This example illustrates the use of the ruby-position property:
|
||||
<head> <style> ruby.example { background-color: #EAE9E6; } rt.example { font-size: 12px; color: red; } </style> </head> <body> <ruby class="example" style="ruby-position: inline;"> Inline. <rt class="example">Ruby text.</rt> </ruby> <br /><br /> <ruby class="example" style="ruby-position: above;"> Above. <rt class="example">Ruby text.</rt> </ruby> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the rubyPosition property in JavaScript:
|
||||
<head> <script type="text/javascript"> function ChangeRubyPosition (selectTag) { // Returns the index of the selected option var whichSelected = selectTag.selectedIndex; // Returns the text of the selected option var rubyValue = selectTag.options[whichSelected].text; var ruby = document.getElementById ("myRuby"); if ('rubyPosition' in ruby.style) { ruby.style.rubyPosition = rubyValue; } else { alert ("Your browser doesn't support this example!"); } } </script> </head> <body> <ruby id="myRuby"> Ruby base. <rt>Ruby text.</rt> </ruby> <br /><br /> Change rubyPosition property: <br /> <select onchange="ChangeRubyPosition (this)" size="2"> <option selected="selected" />above <option />inline </select> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
CSSStyleDeclaration, htmlElement.currentStyle, htmlElement.runtimeStyle, htmlElement.style
HTML elements:
Related pages:
rubyAlign
rubyOverhang
imeMode
layoutFlow
layoutGrid
layoutGridChar
layoutGridLine
layoutGridMode
layoutGridType
textJustify
textKashidaSpace
unicodeBidi
rubyOverhang
imeMode
layoutFlow
layoutGrid
layoutGridChar
layoutGridLine
layoutGridMode
layoutGridType
textJustify
textKashidaSpace
unicodeBidi
External links:
User Contributed Comments