Search code examples
htmlcssword-wrapword-break

Difference between overflow-wrap and word-break?


What´s the exact difference between overflow-wrap/word-wrap and word-break? And can anybody tell me what´s the better one for breaking very long links? Most people say you should use word-break in combination with overflow-wrap but it doesn't look very logical. I think using overflow-wrap in combination with word-wrap for better cross-browser support is the best method. What do you think?


Solution

  • Quoting from source

    • overflow-wrap: The overflow-wrap CSS property is used to specify whether or not the browser may break lines within words in order to prevent overflow when an otherwise unbreakable string is too long to fit in its containing box.

    • word-wrap: The word-wrap property was renamed to overflow-wrap in CSS3.

    • word-break: The word-break CSS property is used to specify how (or if) to break lines within words

    So, you need word-break in combination with word-wrap, which is the right combination.