我们希望避免长词溢出行,并在必要时让它们被打断,标准方法是
word-wrap: break-word
或其等效物
overflow-wrap: break-word
但是,我们发现这不适用于 Safari(包括 Mac 和 iOS)。
然后我们偶然发现 word-break
CSS 属性,它应该只接受 break-all
的值,意思是在任何地方中断,显然采用了 break-word
的未记录值(Chrome 也接受这一点),并且以下内容
word-wrap: break-word;
word-break: break-word;
似乎可以解决 Safari 上的问题。
我无法在网络上找到任何对 word-break
的非标准 break-word
值或任何 Safari“错误”的引用word-wrap: break-word
使用 word-break: break-word
可以解决。
最佳答案
据我所知 word-break: break-word;
是非标准的,仅限 webkit。它可以在 Safari CSS Reference 上找到
word-break Specifies the level of strictness when breaking lines of text in ideographic languages such as Chinese, Japanese, and Korean.
Syntax word-break: strictness Parameters strictness The level of strictness. Constants break-all, break-word, normal Availability Available in Safari 3.0 and later. Available in iOS 2.0 and later. Support Level Stable CSS 3.
关于css - 未记录的断字 : break-word CSS property?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30169301/