At 11:44 AM -0700 12/3/07, Ann Randall wrote:

>While CSS does not have a property for aligning horizontally...

    Actually, it does, at least in this context: 'text-align', which 
will center the contents of each line of text within its line box. 
Therefore, assuming the line boxes to be as wide as the enclosing 
div, the text will be horizontally centered. 
(http://www.w3.org/TR/CSS21/text.html#alignment-prop)

>...it does
>have a property for aligning vertically. Check "vertical-align" in the
>W3C property table at
>http://www.w3.org/TR/2004/CR-CSS21-20040225/propidx.html

    This won't help vertically center a line of text in a div, though 
it would help vertically center a line of text within any element 
whose 'display' is 'table-cell' (like table cells).
    There are a variety of techniques for vertically centering 
content, but most of them involve knowing ahead of time the height of 
the content.  So it's fairly easy to vertically center an image, for 
example, but not necessarily text.

-- 
Eric A. Meyer (http://meyerweb.com/eric/), List Chaperone
"CSS is much too interesting and elegant to be not taken seriously."
   -- Martina Kosloff (http://mako4css.com/)
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to