我不明白为什么有两个属性似乎做同样的事情,但它们的相互关系似乎没有在规范中定义。
I don't understand why there are two properties that seem to do the same thing, yet their interrelation does not appear to be defined within the spec.
dev.w3/csswg/css-text -3 /#word-break-property
dev.w3/csswg/css-text-3/#overflow-wrap-property
例如,如果我想要按如何在前标签中换行文本?,一些行包含没有空格的字符串(这似乎使Chrome认为它们是不可破坏的(即使他们有逗号等)) ,我还要使用 word-break:break-all 或 word-wrap:break-word 到白空间:预封装?
For example, if I want text wrapped as per How do I wrap text in a pre tag?, and some lines contain strings with no spaces (which seems to make Chrome think they're non-breakable (even if they do have commas and such)), do I want to use word-break: break-all or word-wrap: break-word, in addition to white-space: pre-wrap?
推荐答案:break-all 破解其他行中的句子和文本 word-wrap:break-word`它不打破句子它的断行和全句go to next line without break
word-break: break-allits break the sentence and text in other line word-wrap: break-word` its not break the sentence its break the line and full sentence go to next line without break
p { width:100px; word-break:break-all; padding-left:20px; } div { width:100px; word-wrap: break-word; padding-left:20px; }
<body> <p>India's Saina Nehwal won the Australian Badminton Open Super Series title at the State Sports Centre in Sydney on 29 June, 2014. Saina began the match in aggressive fashion as she raced into a 12-8 lead in the first game against Spain's Carolina Marin in the final.</p> <div>India's Saina Nehwal won the Australian Badminton Open Super Series title at the State Sports Centre in Sydney on 29 June, 2014. Saina began the match in aggressive fashion as she raced into a 12-8 lead in the first game against Spain's Carolina Marin in the final. </div> </body>
更多推荐
“word
发布评论