W3C home > Mailing lists > Public > www-style@w3.org > October 2001

RE: How is it possible to devise such a feeble system?

From: Peter Foti (PeterF) <PeterF@SystolicNetworks.com>
Date: Wed, 24 Oct 2001 14:26:30 -0400
Message-ID: <A10A983C9DFBD4119F0300104B2EA6B7086003@ZIPPY>
To: "'www-style@w3.org'" <www-style@w3.org>
> > This raises a new question.  Wouldn't "text-align" be more 
> appropriately
> > called "horizontal-align"?  I mean, you might have non-text 
> items within
> > the element that you are applying the alignment to.
> 
> Because text-align only aligns inline content. 


No, text-align applies only to block level content.  vertical-align only
applies to inline.

For example, using this style sheet:
<style type="text/css">
.example1
{
   text-align: center;
}
</style>


with this code:

<div class="example1">
   <div>Text 1</div>
   <div>More text</div>
</div>

Should result in both lines being centered.




> It does not align block
> children.  So something like:
> 
> <div style="text-align: center">
> <div style="width: 50%">Text</div>
> </div>
> 
> Would center "Text" within the inner div (by inheritance) but 
> not center
> the inner div within the outer one (because a div is block content).
> 
> Boris
> -----------------
> 617-864-9910
> -----------------
> Computer, n: 
>    A device to speed up and automate errors
> 
> 
Received on Wednesday, 24 October 2001 14:27:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:11 GMT