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

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 24 Oct 2001 14:54:35 -0400
Message-Id: <200110241854.OAA02077@no-knife.mit.edu>
To: "Peter Foti (PeterF)" <PeterF@SystolicNetworks.com>
cc: "'www-style@w3.org'" <www-style@w3.org>
> No, text-align applies only to block level content.  vertical-align only
> applies to inline.

It only _applies_ to block content.  It _affects_ the way the inline
children of the block are shown.

If you try your example in an actual browser, you should see that both
lines _are_ centered, but the <div> elements about them are not.  They
just have the width of the parent and the text is centered _within_

Try adding borders and a percentage width to the inner divs to see what
the layout actually looks like.  Then test several browsers, because
some have a buggy implementation of text-align that aligns blocks and
not just inlines.  :)

> 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>

Jacquin's Postulate on Democratic Government:

   No man's life, liberty, or property are safe while
the legislature is in session.
Received on Wednesday, 24 October 2001 14:54:37 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:59 UTC