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:

CSS2.1
http://www.w3.org/TR/CSS2/text.html#spacing-props
    'letter-spacing'
    ...
    normal
      ... This value allows the user agent to alter the space between characters in order to justify text.
    <length>
      ...  User agents may not further increase or decrease the inter-character space in order to justify text.

CSS3 Text
http://www.w3.org/TR/css3-text/#spacing-limits
    <spacing-limits> = [ normal | <length> | <percentage>]{1,3}
      ... If just one value is specified, then it represents the optimum, minimum, and maximum.
http://www.w3.org/TR/css3-text/#text-justify
    ... 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?)
https://dl.dropbox.com/u/64715801/word-spacing-justify.html
https://dl.dropbox.com/u/64715801/letter-spacing-justify.html

Regards,

-- 
MURAKAMI Shinyu
http://twitter.com/MurakamiShinyu
Antenna House Formatter:
http://www.antennahouse.com
Received on Thursday, 17 January 2013 03:41:48 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT