"anywhere"在"word-wrap"css属性中是什么意思?

What does "anywhere" mean in "word-wrap" css property?

我刚刚在 Firefox 中注意到(我假设它在 Chrome 中是相同的)一个名为 "anywhere" 的新 属性 值 属性 "word-wrap"。它有什么作用?我记得使用 normal(默认)或 break-word(大多数用途),但 "anywhere" 是什么意思?它与 "break-word" 有何不同? Mozilla.org 没有在他们的手册中列出(还没有?)

"anywhere" 似乎和 "break-word" 做同样的事情。我在 Firefox 67.0

中看到了这个
word-wrap: anywhere;

我真的不知道该怎么做。有用吗?它一直都在那里,我只是错过了它吗?

参考the specification找到定义:

anywhere

An otherwise unbreakable sequence of characters may be broken at an arbitrary point if there are no otherwise-acceptable break points in the line. Shaping characters are still shaped as if the word were not broken, and grapheme clusters must stay together as one unit. No hyphenation character is inserted at the break point. Soft wrap opportunities introduced by anywhere are considered when calculating min-content intrinsic sizes.

稍后您可以阅读:

break-word

As for anywhere except that soft wrap opportunities introduced by break-word are not considered when calculating min-content intrinsic sizes.


请注意浏览器支持非常有限:

https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#Browser_compatibility