I will admit that I have a habit of using
between words when I don't want them to break (table headers for example). Should I really be styling my element with white-space:nowrap
? Are there advantages/disadvantages to either if the only thing I am looking to do is keep words from wrapping?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
There are cases where nonbreaking space cannot help:
hyphens: auto
is used for element containing text to make hyphenation automatically.In these cases,
white-space: nowrap
is useful. Also, nonbreaking space works regardless of whether styles are applied to document while CSS rules work solely when styles are enabled.