htmlcss

The word-wrap property is used in CSS and certain HTML elements. It was introduced in Gecko 1.9.1. This property is used to to specify whether or not the browser is allowed to break lines within words in order to prevent overflow when an otherwise unbreakable string is too long to fit.


Values


HTML example:

<span style="word-wrap:break-word; background:green; width:15em;">exampexamplexamplexamplexampl</span>


CSS h1 example:

h1 {
    background:green;
    width:15em;
    word-wrap:break-word;
}

See Also