

The white-space property is mostly used in anchor text or links. I personally never used most of the white-space values and in your case, it may be the same. In most cases, you will need “ nowrap” in the real world. The longest word in English pneumonoultramicroscopicsilicovolcanoconiosisįrom the above example, you see that you can use the white-space property to wrap texts or display them in the same line. The longest word in English pneumonoultramicroscopicsilicovolcanoconiosis white-space: inherit ↓ The longest word in English pneumonoultramicroscopicsilicovolcanoconiosis white-space: initial ↓ The longest word in English pneumonoultramicroscopicsilicovolcanoconiosis white-space: pre-wrap ↓ The longest word in English pneumonoultramicroscopicsilicovolcanoconiosis white-space: pre-line ↓ The longest word in English pneumonoultramicroscopicsilicovolcanoconiosis white-space: pre ↓ The longest word in English pneumonoultramicroscopicsilicovolcanoconiosis white-space: nowrap ↓ In the same vein, if a container div or section, or element is set to “word-wrap: break-word”, then you don’t have to set it again for the child elements if you want the word break. And you don’t have to set this property again if you want to break it. Let’s say, the HTML “ body” is set to “word-wrap: break-word” then the other tags will inherit or borrow this value from the body. The “ inherit” value may seem confusing to some of you. In order to wrap certain text in your HTML document, this is how you can use it. However, in most cases, you need a “word-break” value for the word-wrap CSS property. The longest word in English pneumonoultramicroscopicsilicovolcanoconiosis Inherits from parent or container element The longest word in English pneumonoultramicroscopicsilicovolcanoconiosis This also comes from default value word-wrap: inherit ↓ The longest word in English pneumonoultramicroscopicsilicovolcanoconiosis Allows long words to break in the next line word-wrap: initial ↓ The longest word in English pneumonoultramicroscopicsilicovolcanoconiosis default value word-wrap: break-word ↓
