W3C home > Mailing lists > Public > www-style@w3.org > February 2010

text-align:justify, inline-blocks, and MS test inline-formatting-context-019.xht

From: Bruno Fassino <fassino@gmail.com>
Date: Tue, 9 Feb 2010 09:21:56 +0100
Message-ID: <da98bce01002090021h54252792mf1c3b077a0d9c4d4@mail.gmail.com>
To: www-style <www-style@w3.org>
At 9.4.2 :
"When the total width of the inline boxes on a line is less than the
width of the line box containing them, their horizontal distribution
within the line box is determined by the 'text-align' property.
If that property has the value 'justify', the user agent may stretch
spaces and words in inline boxes (except for inline-table and
inline-block boxes) as well"

What does the part  "(except for inline-table and inline-block boxes)"  mean?
I don't think it means that  "inside"  inline-tables and inline-blocks
 there is no stretching of spaces and words when text-align:justify.

I think that the Microsoft test
adds more confusion. It has the following assertion:

" If 'text-align' is set to 'justify' the user agent does not stretch
spaces and/or words when the 'display' property is set to
'inline-block' "

which again seems to imply that "inside" inline-block elements spaces
and/or words are not stretched when 'text-align' is set to 'justify'.
But then the test is not really precise. The reason why the second
line is not stretched is simply that it is the _last_ (and the only
one) inside the inline-block element. The first line is instead
stretched because it is the first of two consecutive lines (the second
one including just the inline-block box, acting like a single word).
If some text is added inside the inline block to have two lines, then
stretching will occur here as well, in all browsers, see for example
this modified version

Inline-block elements generate a single inline box (whose width is not
affected by text-align), but then inside them text-align works as
usual in all browsers, with possible stretching when it is 'justify'
and there is more than a line.  So I can't figure out what the spec
wanted to exclude when saying:  "(except for inline-table and
inline-block boxes)"
Maybe it simply wanted to say that the "external" single inline box
generated by an inline-block element is not stretched by text-align,
but the current words do not really say this.

Best regards,

Bruno Fassino http://www.brunildo.org/test
Received on Tuesday, 9 February 2010 08:22:29 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 16:28:07 UTC