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:

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.

  

 

 

 

back to top