Forum Moderators: open

Message Too Old, No Replies

<nobr> no good

Alternative?

         

Tonearm

7:44 pm on Dec 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What should I use instead of the nobr tag to keep a chunk of text from wrapping?

rocknbil

8:17 pm on Dec 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[selector] { white-space:nowrap }
Some compatibility issues, but usually works
Or in a table cell <TD NOWRAP> always works.

Tonearm

9:03 pm on Dec 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Got it, thanks!

choster

9:07 pm on Dec 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In XHTML, that becomes <td nowrap="nowrap"> and I believe it is gone altogether in strict XHTML 1.0.; white-space:nowrap is recognized by all the major browsers. Depending on what you are trying to do it may be easier to use non-breaking spaces (&nbsp; or &#160;), except the odd search engines may not recognize it as a space.

Tonearm

9:24 pm on Dec 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So &nbsp; is a non-breaking space. I always use that along with a real space to create a double-space. Is there a more appropriate way?

Purple Martin

12:20 am on Dec 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[selector] { word-spacing: 30px; }

I used 30px because that's the example given at W3Schools, however I think that an em value would be much more appropriate: 2em should give a space that is as wide as two 'm' chars in whatever font you're using.

[w3schools.com...]

Tonearm

1:07 am on Dec 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only problem with that is I only use the double spaces after a period.