& nbsp; vs white-space: nowrap

I admit that I have a habit of using  between words when I don’t want to break them (for example, table headings).

Do I really need white-space:nowrapmy item with white-space:nowrap? Are there any advantages / disadvantages to any of them if the only thing I want to do is to prevent word wrap?

+7
source share
1 answer

There are times when insecure space cannot help:

  • the word contains a hyphen (for example, a web developer);
  • hyphens: auto used for an element containing text for automatic hyphenation.

white-space: nowrap. , , , CSS , .

+7

All Articles