CSS3文本(六)—word-wrap自动换行

word-wrap

说明:检索或设置对象中的单词之间间隔。在 CSS3 中,word-wrap 属性允许您允许文本强制文本进行换行 – 即使这意味着会对单词进行拆分

语法:word-wrap:normal(默认值) | break-word

1)normal:允许内容顶开或溢出指定的容器边界。

2)break-word:内容将在边界内换行。如果需要,单词内部允许断行。

示例:

p {word-wrap:break-word;}

normal:

This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.

break-word:

break-word:This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.

点赞

发表评论