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

text-align


This property sets the horizontal alignment of elements. Values are left, right, center, and justify. The default value is left. This property is similar to the align attribute available with HTML/ XHTML block-level tags such as <p>. Justification may produce poor results: showing white space "rivers" in large text bodies because of screen resizing.

Examples


.goleft {text-align: left;}
p {text-align: justify;}
h1.cent {text-align: center;}

Browser and CSS Support Notes


CSS1
IE 3, 4 (no justification), 5, 5.5, 6
Nav 4, 4.5-4.7 (quirks), 6, 7
Opera 4, 5, 6, 7

(X)HTML Elements
CSS Properties
Back: table-layout Next: text-decoration
< Home | About | Chapters | Examples | Errata | Reference | Site Map >