目录

word-wrap

word-wrap 属性允许长的内容可以自动换行。

 

语法

word-wrap: normal|break-word;

描述
normal只在允许的断字点换行(浏览器保持默认处理)。
break-word在长单词或 URL 地址内部进行换行。

例子

HTML

<p class="test"> This paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.</p>

CSS

p.test
{
	width:11em; 
	border:1px solid #000000;
	word-wrap:break-word;
}

执行结果

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

参考

相关链接

外部链接