CSS overflow-wrap — Control wrapping of text overflow or wrapping

This css works in most common browsers (including IE)

word-wrap: break-word; //ie specific
overflow-wrap: break-word //other browsers

Internet Explorer has its own implementation for “overflow-wrap” -> “word-wrap”.

A readymade sass mixin:

/* Usage: .box { @include wordBreak; } */
@mixin wordBreak {
word-wrap: break-word; //ie specific
overflow-wrap: break-word //other browsers
}

Source: CSS overflow-wrap — Control wrapping of text overflow or wrapping – CSS: Cascading Style Sheets | MDN

Leave a Reply