...

View Full Version : wrapping with  



hessodreamy
01-31-2007, 10:41 AM
Just had a look in IE7 and FF1.5 and it seems to me that using   as whitespace (eg "I've got a lovely bunch of coconuts") does not result in the text wrapping to the size of its container. To get a wrap you have to use an actual space ("I've got a lovely bunch of coconuts"). Is this right? I thought for a minute I was going mad :confused:

Bill Posters
01-31-2007, 11:17 AM
  = non-breaking space

hessodreamy
01-31-2007, 11:35 AM
heh. Any chance we could delete this thread to save me looking sheepish :o
Hadn't really thought that through. Always just accepted   as necessary substitution for space, for compliance.
Looking at w3c specs on whitespace:

This specification does not indicate the behavior, rendering or otherwise, of space characters other than those explicitly identified here as white space characters. For this reason, authors should use appropriate elements and styles to achieve visual formatting effects that involve white space, rather than space characters.
I find this a little unclear. Is it saying we should avoid using space characters in all cases? or, by 'visual formatting' does it mean things like an extra long gap between words?
For w3c compliance should normal (breaking) spaces be substituted with an ascii space (   )? Of course you can get by in most cases with a space character, but while we're on the subject...

Bill Posters
01-31-2007, 12:19 PM
authors should use appropriate elements and styles to achieve visual formatting effects that involve white space, rather than space characters.
I'd interpret that spec statement as to mean 'special' visual formatting such as keeping the two parts of a person's name together (in the event that it's felt important to do so).

e.g.

John Doe

The spaces between words in normally flowing text can use yer common or garden space (space bar) character.
Afaik, a space character is interpretted appropriately by all known UAs. (Any UA which demanded the use of the ascii char code instead of a basic space character would fall out of favour pretty quickly due to the number of pages it failed to render correctly.)

Character encoding does much of the donkey work.

hessodreamy
01-31-2007, 12:24 PM
ok. thanks for clearing that up for me.

GJay
01-31-2007, 12:44 PM
browsers will often (always?) remove multiple spaces between words, so if you do want increased spacing then   can be used then.

Bill Posters
01-31-2007, 01:11 PM
browsers will often (always?) remove multiple spaces between words, so if you do want increased spacing then   can be used then.


I think it's likely to be always. I believe that it's part of the spec that regular spaces are 'non-cumulative', whereas   are cumulative.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum