Re: text:align:justify

Frank Boumphrey wrote:

> "15.2 Alignment the 'text-align' property."....
>  .... "This property describes how a paragraph of text is aligned. More
> precisely, it specifies how boxes in each line box of a block align width
> respect to the line box. (Note that alignment is not with respect to the
> viewport but the current containing block.)"
>
> Does this imply that  when text-align is set to justify the flow objects
> contained in the parent element (say a <DIV> with its width property set to
> 40%) should also be stretched border to border?

No. The quoted section is referring to inline elements and to line boxes
occurring within a block element such as a paragraph. The parent element in
that case is the paragraph - the nearest enclosing block element.

This will have no effect on the width of other, enclosing block elements such
as a div around the paragraph.

"border to border" seems to imply the viewport, but as the quote above shows
this depends on how the width was specified.

A div with width set to 40% will indeed be set relative to the viewport, but it
is the actual computed width (viewport size times 0.4) that is the inherited
value. So the paragraph will inherit that value and (unless it sets its own
width) will be the same width, and then the justified lines within that
paragraph will be justified across that width. If the viewport is resized, the
div will resize and thus the paragraph will resize.

A paragraph whose width is set to, say, 800 pixelsand justified will arrange
it's line boxes and any child inline elements so they justify across 800
pixels. If the viewport is 500 pixels you won't see all of the text, and will
typically get a horizontal scrollbar.

--
Chris Lilley, W3C                             http://www.w3.org/
Graphics,Fonts,Stylesheets Guy    The World Wide Web Consortium
http://www.w3.org/people/chris/              INRIA,  Projet W3C
chris@w3.org                       2004 Rt des Lucioles / BP 93
+33 (0)492 387 987 <NEW    06902 Sophia Antipolis Cedex, France

Received on Saturday, 14 February 1998 07:41:07 UTC