"word-break: break-all" 和 "word-break: break-all" 有什么区别?与“word-wrap:break-word"相比在 CSS 中

2022-01-30 00:00:00 word-wrap css

I am currently wondering what is the difference between the two. When I used both they seem to break the word if it is not fitting the container. But why did W3C made two ways to do it?

解决方案

The W3 specification that talks about these seem to suggest that word-break: break-all is for requiring a particular behaviour with CJK (Chinese, Japanese, and Korean) text, whereas word-wrap: break-word is the more general, non-CJK-aware, behaviour.

相关文章