NOTICE: This website is no longer updated or supported - as such many of the techniques used to build it may seem antiquated in the modern day. It is preserved for historical reasons only.

HTML XHTML The Complete Reference
home » reference » appendix b » css1 / css2 properties

vertical-align


This property sets the vertical positioning of text and images with respect to the baseline setting. Possible values are baseline, sub, super, top, text-top, middle, bottom, and text-bottom. A value of top aligns the top of text or images with the top of the tallest element, relative to the baseline. A value of text-top aligns the top of text or images with the top of the font in the containing element while text-bottom aligns things with the bottom of the font. A value of middle aligns the middle of text or images to the middle of the x-height of the containing element. A value of bottom aligns the bottom of text or images with the bottom of the lowest element, relative to the baseline. The sub and super values provide subscript and superscript style. Percentages can also be given as values. The default value is baseline.

Examples


p {vertical-align: top;}
.dive {vertical-align: sub;}
.climb {vertical-align: super;}

Browser and CSS Support Notes


CSS1
IE 4, 5 (buggy), 5.5, 6
Nav 4, 4.5-4.8 (buggy), 6, 7
Opera 4, 5, 6, 7

(X)HTML Elements
CSS Properties
Back: unicode-bidi Next: visibility
< Home | About | Chapters | Examples | Errata | Reference | Site Map >