| <!DOCTYPE html> |
| <!-- |
| | Wrapping is only performed at an allowed break point, called a soft wrap |
| | opportunity. In most writing systems, in the absence of hyphenation a soft |
| | wrap opportunity occurs only at word boundaries. However, when the |
| | word-wrap property has a value of break-word, unbreakable "words" may be |
| | broken at an arbitrary point to prevent overflow, while still preserving |
| | grapheme clusters. |
| | https://www.w3.org/TR/css3-text/#soft-wrap-opportunity |
| | https://www.w3.org/TR/css-text-3/#line-break-details |
| | https://www.w3.org/TR/css-text-3/#word-wrap |
| | |
| | When no soft wrap location can be found and break-word is allowed, the last |
| | grapheme cluster boundary that can fully fit within the width will be |
| | selected. |
| --> |
| <html> |
| <head> |
| <style> |
| body { |
| margin: 0px; |
| font-family: Roboto; |
| font-size: 20px; |
| } |
| .containing-block { |
| background-color: #03a9f4; |
| width: 100px; |
| } |
| .word-wrap-break-word { |
| word-wrap: break-word; |
| } |
| .word-wrap-normal { |
| word-wrap: normal; |
| } |
| </style> |
| </head> |
| <body> |
| <div class="containing-block"> |
| <div class="word-wrap-break-word"><span>abcd<span class="word-wrap-normal">efgh</span>ijkl</span></div> |
| <div class="word-wrap-normal"><span>abcd<span class="word-wrap-break-word">efgh</span>ijkl</span></div> |
| <div class="word-wrap-normal"><span><span class="word-wrap-break-word">abcd</span><span>efgh</span>ijkl</span></div> |
| <div class="word-wrap-normal"><span>abcd<span>efgh</span>ijkl</span></div> |
| </div> |
| </body> |
| </html> |