vertical-align Attribute | verticalAlign Property

MS Office DHTML, HTML & CSS

vertical-align Attribute | verticalAlign Property


Sets or retrieves the vertical positioning of the object.

Syntax

HTML{ vertical-align: sAlign }
Scriptingobject.style.verticalAlign [ = sAlign ]

Possible Values

sAlign String that specifies one of the following values:
baselineAligns the contents of an object supporting VALIGN to the base line.
subVertically aligns the text to subscript.
superVertically aligns the text to superscript.
topVertically aligns the contents of an object supporting VALIGN to the top of the object.
middleVertically aligns the contents of an object supporting VALIGN to the middle of the object.
bottomVertically aligns the contents of an object supporting VALIGN to the bottom of the object.
text-topVertically aligns the text of an object supporting VALIGN to the top of the object.
text-bottomVertically 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 propertiesInternet Link.

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>

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
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

Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.