-ms-text-underline-position Attribute | textUnderlinePosition Property
Gets or sets the position of the underline decoration that is set through the textDecoration property of the object.
Syntax
CSS { -ms-text-underline-position : sPosition } Scripting [ sPosition = ] object.style.textUnderlinePosition
Possible Values
sPosition String that specifies or receives one of the following values.
above- Decoration appears above the text.
below- Decoration appears below the text.
- auto
- Default. Microsoft Internet Explorer 6 and later. Decoration appears above the text if the LANG attribute is set to
ja, which is the language code abbreviation for the Japanese language, and the -ms-writing-mode attribute is set totb-rl, which causes vertical inline text progression. If not, the decoration appears below the text.auto-pos- Internet Explorer 6 and later. Identical to
auto.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 Microsoft Cascading Style Sheets (CSS) extension is 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
Windows Internet Explorer 8. The -ms-text-underline-position attribute is an extension to CSS, and can be used as a synonym for text-underline-position in IE8 Standards mode.
This property specifies the position of the underline decoration. To turn the decoration on or off, use the textDecoration property.
The position of the underline decoration is relative to the layout of the text in the object. With vertical text, it is more accurate to say that the
abovevalue causes the underline decoration to be laid out before the text or that the decoration appears before the text. With thebelowvalue, then, the decoration appears after the text.In Internet Explorer 6, The
autoandauto-posvalues apply to this property as of Internet Explorer 6. The default value of this property isautoas of Internet Explorer 6. With Internet Explorer 5.5, the default value of this property isbelow.
Examples
The following example shows how all of the elements in a document inherit the textUnderlinePosition style rule from the parent HTML element. Underline decorations throughout the document are positioned above the text, relative to the layout of the text.
<HTML STYLE="text-underline-position:above"> <HEAD><TITLE></TITLE></HEAD> <BODY> <P><SPAN>This horizontal SPAN element is not underlined.</SPAN> <SPAN STYLE="text-decoration:underline">This horizontal SPAN element is underlined above the text.</SPAN></P> <P STYLE="writing-mode:tb-rl"><SPAN>This vertical SPAN element is not underlined.</SPAN> <SPAN STYLE="text-decoration:underline">This vertical SPAN element is underlined above the text.</SPAN></P>Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/textUnderlinePosition.htm
The following example demonstrates the effect of the
autovalue of the textUnderlinePosition property when the LANG attribute of an object containing vertical inline text is set toja.<div style="writing-mode:tb-rl; text-decoration:underline; text-underline-position:auto"> <p>This element contains underlined vertical text. The LANG attribute of this element is not explicitly set. The underline decoration appears below, or after, the text when text-underline-position is set to auto.</p> <p lang="ja">This element also contains underlined vertical text. The LANG attribute of this element is set to ja. The underline decoration in this element appears above, or before the text.</p> </div>Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/textUnderlinePositionAuto.htm
Standards Information
This property is a Microsoft extension to Cascading Style Sheets (CSS).
Applies To
A, ABBR, ACRONYM, ADDRESS, APPLET, B, BASE, BASEFONT, BDO, BGSOUND, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, CSSStyleDeclaration, currentStyle, CUSTOM, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAMESET, HEAD, hn, HR, HTML, I, IMG, INPUT, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, INS, ISINDEX, KBD, LABEL, LEGEND, LI, LINK, LISTING, MARQUEE, MENU, nextID, NOBR, NOFRAMES, NOSCRIPT, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, RT, RUBY, runtimeStyle, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, style, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, XML, XMP, CSSCurrentStyleDeclaration Constructor, CSSRuleStyleDeclaration Constructor, CSSStyleDeclaration Constructor
See Also