microsoft.com Home   All Products  |   Support  |   Search  |   microsoft.com Home  
Microsoft

Microsoft Typography | Typography on the Web | Specifying... | 5.4.4 'vertical-align' next


5.4.4 'vertical-align'

Value: baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage>
Initial: baseline
Applies to: inline elements
Inherited: no
Percentage values: refer to the 'line-height' of the element itself
Microsoft® Internet Explorer 3.0 support: ?
Microsoft Internet Explorer 4.0 support: ?


The property affects the vertical positioning of the element. One set of keywords is relative to the parent element:

'baseline'
align the baseline of the element (or the bottom, if the element doesn't have a baseline) with the baseline of the parent

'middle'
align the vertical midpoint of the element (typically an image) with the baseline plus half the x-height of the parent

'sub'
subscript the element

'super'
superscript the element

'text-top'
align the top of the element with the top of the parent element's font

'text-bottom'
align the bottom of the element with the bottom of the parent element's font

Another set of properties are relative to the formatted line that the element is a part of:

'top'
align the top of the element with the tallest element on the line

'bottom'
align the bottom of the element with the lowest element on the line

Using the 'top' and 'bottom' alignment, unsolvable situations can occur where element dependencies form a loop.

Percentage values refer to the value of the 'line-height' property of the element itself. They raise the baseline of the element (or the bottom, if it has no baseline) the specified amount above the baseline of the parent. Negative values are possible. E.g., a value of '-100%' will lower the element so that the baseline of the element ends up where the baseline of the next line should have been. This allows precise control over the vertical position of elements (such as images that are used in place of letters) that don't have a baseline.



Dark blue text is taken from Cascading Style Sheets, level 1. W3C Recommendation 17 December 1996 - http://www.w3.org/pub/WWW/TR/REC-CSS1

this text [ext link] signifies an external link, please read our disclaimer.

this page was last updated 2 December 1997
© 1997 Microsoft Corporation. All rights reserved. Terms of use.
comments to the MST group: how to contact us

 

Microsoft Typography | Typography on the Web | Specifying... | 5.4.4 'vertical-align' next