rubyAlign style property
Specifies or returns the horizontal alignment of the Ruby text defined by the rt tag, relative to the base text defined by the ruby tag.
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-align |
Possible values:
The type of this property is string.
One of the following values:
Default. Browser determines how the Ruby text (rt) is to be aligned. | |||||||
The Ruby text rt is centered within the width of the base ruby's content. | |||||||
If the width of the Ruby text (rt) is smaller than the width of the base ruby's content, then the Ruby text (rt) is evenly distributed across the width of the base content ruby. | |||||||
If the width of the Ruby text (rt) is smaller than the width of the base ruby's content, then the Ruby text (rt) is centered and the left/right margin is filled up with whitespaces. | |||||||
The Ruby text rt is aligned to the left of the contents of the base ruby. | |||||||
If it is not adjacent to a line edge, the Ruby text is centered. | |||||||
The Ruby text rt is aligned to the right of the contents of the base ruby. |
Default: auto.
Example HTML code 1:
This example illustrates the use of the ruby-align property:
|
||||
<head> <style> ruby.example { ruby-align: right; background-color: #EAE9E6; } rt.example { font-size: 12px; color: red; } </style> </head> <body> <ruby class="example"> Ruby base. <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 rubyAlign property in JavaScript:
|
||||
<head> <script type="text/javascript"> function ChangeRubyAlign (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 ('rubyAlign' in ruby.style) { ruby.style.rubyAlign = 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 rubyAlign property: <br /> <select onchange="ChangeRubyAlign (this)" size="7"> <option />auto <option />left <option selected="selected" />center <option />right <option />distribute-letter <option />distribute-space <option />line-edge </select> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
CSSStyleDeclaration, htmlElement.currentStyle, htmlElement.runtimeStyle, htmlElement.style
HTML elements:
Related pages:
imeMode
layoutFlow
layoutGrid
layoutGridChar
layoutGridLine
layoutGridMode
layoutGridType
rubyOverhang
rubyPosition
textJustify
textKashidaSpace
unicodeBidi
layoutFlow
layoutGrid
layoutGridChar
layoutGridLine
layoutGridMode
layoutGridType
rubyOverhang
rubyPosition
textJustify
textKashidaSpace
unicodeBidi
External links:
User Contributed Comments