I noticed that a block
element wraps differently with word-wrap: break-word;
then an identically sized inline-block
element. Can anybody explain why? I would have expected them to act the same since both elements are, relative to their contents, block
.
Here is the code:
<span style="word-wrap:break-word; display: inline-block;"> XX-standard-com.longtext.nogoodexperience.howtoresolve_nofix.yyy</span><br/><br/>
<span style="word-wrap:break-word; display: block;"> XX-standard-com.longtext.nogoodexperience.howtoresolve_nofix.yyy</span>
And here is a screenshot of the result (you have to resize your browser to make it wrap):
Tested in Chrome, FF and IE11.
Update
I would point out that both elements are the exact same width when examined in the elements inspector.