XML technologies / CSS / Advanced websites with CSS / Text effects and cascading / Text alignment as a design technique / Text alignment in CSS and HTML
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
Text alignment can be controlled with HTML as well as CSS. However, the element center and the attribute align are now considered obsolete; align is allowed only for marking up table cells.
In CSS, we use the property text-align to set text alignment. The following values are available:
left(left-aligned)center(centred)right(right-aligned)justify(justified)
The default value of text-align is left. The value justify is not required by the W3C recommendations and is not supported by many browsers. center and right are nevertheless among the most important CSS values and are used frequently.
Copyright © 2006 of the German translation, dpunkt.verlag GmbH
You may print the online version for your private use.
Otherwise, this chapter from “CSS − Anspruchsvolle Websites mit Cascading Stylesheets” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19, 69115 Heidelberg
back to top