首先需要启动这一句
word-wrap:break-word;
表示在必要的时候就自动换行
Word-Wrap的默认值是Normal
Normal状态下会导致字的内容超过框架的高度/宽度
然后设置Word-Break的值为
word-break:normal;
Word-Break用于控制断句的方式
有三种的值:
| normal | Default. Allows line breaking within words. |
| break-all | Behaves the same as normal for Asian text, yet allows the line to break arbitrarily for non-Asian text. This value is suited to Asian text that contains some excerpts of non-Asian text.(!会导致英文撕词) |
| keep-all | Does not allow word breaking for Chinese, Japanese, and Korean. Functions the same way as normal for all non-Asian languages. This value is optimized for text that includes small amounts of Chinese, Japanese, or Korean. |
或
word-wrap:break-word;word-break:break-all; 这是自己用的,但还是有问题,上面解释的非常好。
浙公网安备 33010602011771号