How to define word-break property to allow words to be continued to the next line in CSS ?
In this article, we will see how to define a word-break property to allow words to be continued to the next line in CSS. You can use break-all and break-word property values to define the word-break property which is used to specify how to break the word when the word reached at end of the line.
word-break: break-all | break-word;
- break-all: It is used to break the words at any character to prevent overflow.
- break-word: It is used to break the words at arbitrary points to prevent overflow.
Example 1: In this example, we are using the above-explained method.
Example 2: Here is another example of using the word-break property.
Example 3: In this example, we will use the overflow-wrap property. The overflow-wrap property in CSS is used to specify that the browser may break lines of text inside any targeted element to prevent overflow when the original string is too long to fit.
- Google Chrome
- Internet Explorer
Please Login to comment...