How to prevent a wordbreak?

liunx

Guest
I have a section of text that includes the term "-2 penalty", and the linebreak interrupted it - leaving "-2" at the end of the first line, and "penalty" at the beginning of the next line. I was able to prevent that by replacing the space with &nbsp;", however this leaves the minus sign "-" at the end of the first line, and "2 penalty" at the beginning of the next line.<br />
<br />
I tried "<span>-2 penalty</span>" but that didn't work either. Does anyone know how I can fix a term so linebreaks will not interrupt it?<!--content-->Sure...<br />
<br />
You can put an empty non-breaking space like so:<br />
<br />
<br />
<br />
-2&nbsp;penalty<br />
<br />
<br />
<br />
That should do it :)<!--content-->oops... looks like it didn't render.<br />
<br />
Let's try that again:<br />
<br />
<br />
<br />
-2&nbsp;penalty<!--content-->And it caused the break to occur after the minus sign instead. I tried to explain that in my first message, but my &nbsp; got automatically replaced as yours did in your first message.<br />
<br />
What I am probably looking for is a hard-hyphen.<!--content-->Did you try this when you used the span?<br />
<br />
<br />
<span style="white-space: nowrap;">-2 penalty</span><!--content-->Works perfectly.<!--content-->
 
Back
Top