Chazzy97
Chazzy97

Reputation: 95

How to keep &nbsp without empty space?

I have small problem with my text. In some part of text I'm using '&nbsp' to make sure, that specific word will not break(or move) to new line. So for example I did something like this:

Lorem ipsum dolor sit ammet - is not a joke!

So theoretically, this text('- is') shouldn't end up on a new line as a single word, right? I guess that's right. But... That technique brings me one issue which is additional big empty space between "-" and "is"... And of course I don't want to have that "big empty space". I'll give You example of that result:

Lorem ipsum dolor sit ammet -  is not a joke!

As You can see, there is a huge space. So, my question is - how to get rid of that space, but also stick to my target assumption which is "Don't brake '- is' word to the new line as a single word." Is there any technique to use &nbsp without additional space?

Upvotes: 1

Views: 1814

Answers (2)

Cássio Lacerda
Cássio Lacerda

Reputation: 1634

In CSS, try:

white-space:break-spaces

Upvotes: 1

Related Questions