W3C home > Mailing lists > Public > www-style@w3.org > January 2013

[CSS21][css3-text] letter-spacing, word-spacing and justification

From: MURAKAMI Shinyu <murakami@antenna.co.jp>
Date: Thu, 17 Jan 2013 12:41:25 +0900
To: www-style@w3.org
Message-Id: <20130117124124.E57B.C598BCD7@antenna.co.jp>
I often see the following CSS code, I think this has a problem:

p {
  letter-spacing: 0pt;
  word-spacing: 0pt;
  text-align: justify;

In the CSS2.1 and CSS3 Text, the initial value of letter/word-spacing is 'normal', stretchable in justification, and different from the fixed value 0pt. See the spec:

      ... This value allows the user agent to alter the space between characters in order to justify text.
      ...  User agents may not further increase or decrease the inter-character space in order to justify text.

CSS3 Text
    <spacing-limits> = [ normal | <length> | <percentage>]{1,3}
      ... If just one value is specified, then it represents the optimum, minimum, and maximum.
    ... If the inline contents of a line cannot be stretched to the full width of the line box, then they must be aligned as specified by the ‘text-align-last’ property. (If ‘text-align-last’ is ‘justify’, then they must be aligned as for ‘center’ if ‘text-justify’ is ‘distribute’ and as ‘start’ otherwise.)

My questions:
- Is my understanding of the spec correct?--If the value of letter/word-spacing is '0pt', the <spacing-limits> is optimum=minimum=maximum=0pt and cannot be stretched in text justification.

- I tested major browsers with the following samples and found that they stretch the fixed value spacing, the value '0pt' is treated like 'normal'. Is this behavior wrong and should be corrected? (or the CSS spec is wrong?)


Antenna House Formatter:
Received on Thursday, 17 January 2013 03:41:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:25 UTC