Re: Alternative to NOBR tag?

On 4/12/02 9:23 AM, "mgreisman@scanalytics.com" <mgreisman@scanalytics.com>
wrote:

> I had almost the same problem with multiple words that I did not want to
> break. For example:
> | Menu Item 1 | Menu Item 2 | Menu Item 3 |
> 
> The good folks in the HTML Writer's Guild recommended I use non-breaking
> spaces between the words I didn't want to break. Oh, yeah, "non-breaking"
> means something!

Since it is presentation you are concerned with, it is perhaps better to use
a presentational solution (rather than a content solution), e.g. style your
sequence of multiple words that you don't want to break with

 white-space:nowrap;


> This doesn't quite solve Dan's problem with hyphens within phone numbers, but
> it might help...

Precisely - in general you have to use a proper presentational solution
anyway.


> So, what's the final word on the nowrap style? Are we supposed to use that for
> inline elements or not?

Yes, you are.

From the public CSS1 Errata:

 http://www.w3.org/Style/css1-updates/REC-CSS1-19990111-errata.html

"
Section 5.6.2 'white-space'

[2001-08-28] The 'white-space' property applies to all elements, not just
block-level elements.
"

This is also what the CSS1 Test Suite tests:

 http://www.w3.org/Style/CSS/Test/CSS1/current/sec562.htm

and what popular browsers implement (from many vendors, for many platforms).


Tantek

Received on Thursday, 18 April 2002 14:12:48 UTC