Forum Moderators: not2easy

Message Too Old, No Replies

Removing line break in a Hyphenated acronym

One hyphenated word cannot break to next line

         

protools

3:53 pm on Jan 10, 2007 (gmt 0)

10+ Year Member



Hi, I have an acronym that runs throughout my site that is hyphenated ie DRG-t. Is there a way through css...or any other method that I can state that it never break that particular word into the next line, but always keep it together?

ie

the method of making the DRG-
t not break like this.

tia
barbara

Fotiman

4:17 pm on Jan 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Apply the style white-space: nowrap;

For example:

.acro
{
white-space: nowrap;
}

<span class="acro">DRG-t</span>

Robin_reala

5:28 pm on Jan 10, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Alternatively you could replace the hyphen with the unicode character U+2011 NON-BREAKING HYPHEN which does exactly what it says on the tin.