vertical-align Attribute | verticalAlign Property
Sets or retrieves the vertical positioning of the object.
Syntax
HTML { vertical-align: sAlign } Scripting object.style.verticalAlign [ = sAlign ]
Possible Values
sAlign String that specifies one of the following values:
baseline Aligns the contents of an object supporting VALIGN to the base line. sub Vertically aligns the text to subscript. super Vertically aligns the text to superscript. top Vertically aligns the contents of an object supporting VALIGN to the top of the object. middle Vertically aligns the contents of an object supporting VALIGN to the middle of the object. bottom Vertically aligns the contents of an object supporting VALIGN to the bottom of the object. text-top Vertically aligns the text of an object supporting VALIGN to the top of the object. text-bottom Vertically aligns the text of an object supporting VALIGN to the bottom of the object. The property is read/write with a default value of baseline; the cascading style sheets (CSS) attribute is not inherited.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic properties.
Remarks
The values sub and super are supported on text. The other values are supported for objects that support VALIGN.
Example
This example uses of the verticalAlign property to align text within a table cell.
Sample Code
<TABLE BORDER width=100> <TR> <TD onmouseover="this.style.verticalAlign='bottom'" onmouseout="this.style.verticalAlign=''"> text to align</TD> </TR> </TABLE>
Applies To
[ Object Name ] Platform Version Win16: Win32: Mac: Unix: WinCE: Version data is listed when the mouse hovers over a link, or the link has focus. COL, currentStyle, custom, IMG, runtimeStyle, SPAN, style, TBODY, TD, TFOOT, TH, THEAD, TR
Did you find this topic useful? Suggestions for other topics? write us!
© 1999 microsoft corporation. all rights reserved. terms of use.