To force a line break in case of a long word or any long text without spaces use the
overflow-wrap property and set it to
overflow-wrap CSS property applies to inline elements, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box.
The property was originally a nonstandard and unprefixed Microsoft extension called
word-wrap , and was implemented by most browsers with the same name. It has since been renamed to
overflow-wrap , with
word-wrap being an alias.