📜  CSS word-wrap属性

📅  最后修改于: 2020-11-06 00:59:30             🧑  作者: Mango

CSS word-wrap

CSS word-wrap属性用于折断长字并换行到下一行。当不可破坏的字符串太长而无法容纳在容纳盒中时,此属性用于防止溢出。

CSS 属性值

Value Description
normal This property is used to break words only at allowed break points.
break-word It is used to break unbreakable words.
initial It is used to set this property to its default value.
inherit It inherits this property from its parent element.

CSS自动换行示例







In this paragraph, there is a very long word: iamsooooooooooooooooooooooooooooooolongggggggggggggggg.The long word will break and wrap to the next line.

输出:

In this paragraph, there is a very long word: iamsooooooooooooooooooooooooooooooolongggggggggggggggg.The long word will break and wrap to the next line.