Forum Moderators: open

Message Too Old, No Replies

Making two words act as one?

can it be done?

         

Emperor

7:28 pm on Nov 7, 2004 (gmt 0)

10+ Year Member



Hi guys,

I have a simple text link "Click Here" and was wondering if I could make it behave as if it's one word; that is to say if the page breaks in between the words the "Here" starts on a new line, I'd like it so the entire "Click Here" moves to the new line.

Is that possible?

Cyrus

Lance

7:36 pm on Nov 7, 2004 (gmt 0)

10+ Year Member



That's an easy one... Use the HTML entity " " between the words. This is a NonBreakingSPace and does exactly what you want.

Example:
<p>Words Words Words Click&nbsp;Here Words Words Words</p>

SuzyUK

11:56 am on Nov 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or without addition to the HTML..

a {white-space: nowrap;}

<p>Words Words Words <a href="/">Click Here</a> Words Words Words</p>

Lance

12:17 pm on Nov 8, 2004 (gmt 0)

10+ Year Member



<sarcastic joke>
But SuzyUK, this is the HTML forum. Yours is the right answer in the CSS forum.
</sarcastic joke>

Please take that comment in the spirit of humor in which it was intended.

Hester

4:41 pm on Nov 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In which forum would you put inline styles? :D

Lance

4:52 pm on Nov 8, 2004 (gmt 0)

10+ Year Member



Ohh, that's a toughy...

Emperor

7:14 pm on Nov 8, 2004 (gmt 0)

10+ Year Member



Thanks Suzy, I'm trying not to use &nbsp; anywhere.

uncle_bob

8:20 pm on Nov 8, 2004 (gmt 0)

10+ Year Member



You can always try the infrequently used <nobr> </nobr> tags to prevent line breaks.