Previous Message
Next Message

Preventing breaks within non-standard 'words'

Sent by David Leader on 12 September 2004 16:04


In reply to my query about breaks within words at characters like 
'/', Bob Easton replied:

>white-space:nowrap works within block level elements.

My first reaction was 'Did Bob read my message? What has white space 
to do with breaking at forwards slashes? There is no white space in 
my string!'. It turns out that he knew what he was talking about - 
'white-space:nowrap' does prevent any sort of break within the text, 
as the css2 spec (which I have as a pdf on my machine, incidentally) 
states:
'This value collapses whitespace as for 'normal', but suppresses line 
breaks within text except for those created by "\A" in generated 
content (e.g., for the BR element in HTML).'

But I do think I can be excused for having assumed that a property 
entitled 'white-space' would be concerned solely with er, well, white 
space. I imagine - would bet money - that at least 50% of list 
members would have made the same assumption. However, far be it from 
me to venture off topic to discuss the philosophy of css nomenclature 
- there's apparently a special list for css philosophy.

Anyway. Thanks Bob, for putting me right on this.

Bob then goes on to say:

>It sounds as though you need some good reference material, to 
>quickly look up answers, rather than wait 4-5 hours for someone else 
>to answer.

Well thanks again for your suggestion. First, I'm not so impatient 
that I can't wait 4-5 hours (or usually 8 or so hours overnight) - 
life has a slower pace at this side of the Atlantic, and there's 
always the excitement of anticipating a message from someone on the 
list :-). But yes, I do need to supplement my library with another 
css book. However, let's consider the psychology of using reference 
books. I had, as I mentioned, remembered postings on this list about 
white space. I reached for my well-thumbed copy of Eric's O'Reilly 
first edition and looked up the reference section on white space. It 
starts off, in a paraphrase of the css entry (which for all I know 
Eric himself may have written) "This property defines how whitespace 
within elements is treated..." Immediately I think I'm in the wrong 
place, and even if I read the last part "nowrap prevents an element 
from breaking" I assume 'breaking' means 'breaking at white space'. 
Now if I had gone to the narrative section on white-space (pp 92-3) 
in the book, and read it through, I would have seen an example 
showing what white-space:nowrap did more than its name implied, but I 
didn't as I already considered white-space was not what I wanted. 
And, yes, I read the book through when I first bought it, but at that 
time the signal to noise ratio (what I already knew and was 
interested in to the totality) was so low that there's no way I would 
have remembered it. So having books is not quite enough. (Anyone ever 
had the Kafkaesque experience of trying to find out how to do 
something from the Unix Nutshell book when they didn't know the name 
of the command?) It's also a matter of waiting at the right door.

To finish I will ask two questions (probably no answers at the weekend):

1. Which of the "Good books" Bob points to has an index entry for 
'non-breaking' or 'breaks'? A good index makes a good reference book, 
and that might be indicative.
2. Is there anything in the html spec that suggests browsers should 
wrap at forward slashes (my word processor doesn't), or is that a 
decision they've made 'off their own bat' to handle urls?

David
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: