This topic has not yet been rated - Rate this topic

ruby-align Attribute | rubyAlign Property

Gets or sets the position of the ruby text specified by the rt object.

Syntax

CSS { ruby-align : sRubyAlign }
Scripting [ sRubyAlign = ] object.style.rubyAlign

Possible Values

sRubyAlign String that specifies or receives one of the following values:
auto
Default. Browser determines how the ruby text is aligned. The recommended behavior for an ideographic (Asian character) ruby is to be aligned in the distribute-space mode. The recommended behavior for a Latin character ruby is to be aligned in the center mode.
left
Ruby text is left-aligned with the base.
center
Ruby text is centered within the width of the base. If the length of the base is smaller than the length of the ruby text, the base is centered within the width of the ruby text.
right
Ruby text is right-aligned with the base.
distribute-letter
Ruby text is evenly distributed across the width of the base if the width of the ruby text is smaller than the width of the base. If the width of the ruby text is at least the width of the base, the ruby text is center-aligned.
distribute-space
Ruby text is evenly distributed across the width of the base if the width of the ruby text is smaller than the width of the base. White space precedes the first and follows the last character in the ruby text, equal to half the kerning of the ruby text. If the width of the ruby text is at least the width of the base, the ruby text is centered.
line-edge
Ruby text is centered if it is not adjacent to a line edge. If it is adjacent to a line edge, the side of the ruby text lines up with the side of the base text.

The property is read/write for all objects except the following, for which it is read-only: currentStyle. The property has a default value of auto. The Cascading Style Sheets (CSS) attribute is not inherited.

DHTML expressions can be used in place of the preceding value(s). As of Internet Explorer 8, expressions are supported in IE7 Standards mode and IE5 (Quirks) mode only. For more information, see About Dynamic Properties and Defining Document Compatibility.

Remarks

The rubyAlign property specifies the alignment of the ruby text defined by the rt object, and is set on the ruby object.

Example

This example uses the ruby-align attribute and the rubyAlign property to set the alignment of the ruby text. It uses an inline style sheet to set the ruby-align attribute to right.


<RUBY ID=oRuby STYLE = "ruby-align: right">
Ruby base.
<RT>Ruby text.
</RUBY>
<INPUT
TYPE=button VALUE="Center"
onclick="oRuby.style.rubyAlign='center';"
>

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/rubyAlign.htm

Standards Information

This property is defined in Cascading Style Sheets (CSS), Level 3 (CSS3).

Applies To

CSSStyleDeclaration, currentStyle, RUBY, runtimeStyle, style, CSSCurrentStyleDeclaration Constructor, CSSRuleStyleDeclaration Constructor, CSSStyleDeclaration Constructor

See Also

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ