css - 一个单词一个单词地打断一个长句子

标签 css word-break

"Subject to 10% service charge per room per night. Any cancellation or amendments can be made 2 days prior to arrival. Otherwise, one nights’ room rate will be levied. The first night guarantee is required at time of reservation and one night room rental will be charged to the credit card provided in the event of no show, late cancellation or amendment. If any dispute arises, Hotel Rainbow Hong Kong reserves the final decision."

我使用了 css 属性“word-break:break-all”,但效果不佳。 还有一些词被打散了。

最佳答案

** 你需要'word-wrap'属性**

用这个

word-wrap:break-word;

关于css - 一个单词一个单词地打断一个长句子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23056380/

相关文章:

css - Firefox 中没有一致的断字

html - 按钮上的相等填充不均匀分布

html - 使用断字 : break-word; on Firefox

javascript - 旋转 HTML Canvas 圆刻度

javascript - 用CSS实现加权灵活布局

html - 分词样式不适用于带有 '$' 符号的文本

html - CSS 断字 : break-all doesn't break URLs?

jquery - 将长单词分成多行

html - 垂直居中的一个 Div 占一个固定的 Bar Up Top

css - 令人敬畏的字体仅填充图标的四分之一