Is there a way to prevent line breaks before words that are going to break anyway when using word-wrap: break-word;? It seems unnecessary and unattractive. Any suggestions?
For Example:
Consider a div with word-wrap: break-word;, set at a width equal to 23 "x" characters like this:
xxxxxxxxxxxxxxxxxxxxxxx
The innerHTML of the div is "xx xxxxxxxxxxxxxxxxxxxxxxxxxxxx" as follows:
<div>xx xxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
This demonstrates how the innerHTML of the div is presented compared to the desired display within a 23 "x" width.
Current Output:
xx
xxxxxxxxxxxxxxxxxxxxxxx
xxxxx
Desired Output:
xx xxxxxxxxxxxxxxxxxxxxx
xxxxxxxx
Using word-break: break-all; or similar attributes does not solve the issue. I want words that fit within the container width to remain intact without breaking, while only allowing words wider than the container width to break without an initial line break like with word-wrap: break-word; which is both superfluous and unsightly.