【发布时间】:2020-05-08 19:27:05
【问题描述】:
我不希望单词被打断,但是如果单词太长,单词可能会被打断。¨
我用word-break: break-word;
但是在验证 CSS 时会报错:不推荐使用 value break-word
我使用了 StackOverflow 中提供的替代方案:
word-break: break-all; it breaks all words even if the word is not that long-
word-break: normal;
word-break: initial;
word-wrap: break-word;
word-wrap: break-spaces;
overflow-wrap: normal;
overflow-wrap: break-word;
line-break: normal;
line-break: strict;
line-break: anywhere;
但它们都不起作用。他们要么打断所有单词——即使是短词——或者当单词扩展 div-space 时它们不会打断长词。
唯一有效的代码是word-break: break-word;,但已弃用。
word-break: break-word; 的替代品是什么??
【问题讨论】:
标签: css word-break