<!doctype html>
<html>
<head>
<!--网站编码格式,UTF-8 国际编码,GBK或 gb2312 中文编码-->
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="Keywords" content="关键词一,关键词二">
<meta name="Description" content="网站描述内容">
<meta name="Author" content="Yvette Lau">
<title>
Document
</title>
<!--css js 文件的引入-->
<style>
.word{background:#E4FFE9;width:250px;margin:50px auto;padding:20px;font-family:"microsoft
yahei";} /* 强制不换行 */ .nowrap{white-space:nowrap;} /* 允许单词内断句,首先会尝试挪到下一行,看看下一行的宽度够不够,
不够的话就进行单词内的断句 */ .breakword{word-wrap: break-word;} /* 断句时,不会把长单词挪到下一行,而是直接进行单词内的断句
*/ .breakAll{word-break:break-all;} /* 超出部分显示省略号 */ .ellipsis{text-overflow:ellipsis;overflow:hidden;}
</style>
</head>
<body>
<div>
<p>wordwrap:breakword;absavhsafhuafdfbjhfvsalguvfaihuivfs</p>
<p>wordwrap:break-word;absavhsafhuafdfbjhfvsalguvfaihui</p>
<p>wordwrap:break-word;absavhsafhuafdfbjhfvsalguvfaihuivf</p>
<p>wordwrap:breakword;absavhsafhuafdfbjhfvsalguvfaihuivfsa</p>
<p>wordwrap:breakword;absavhsafhuafdfbjhfvsalguvfaihuivfsab</p>
</div>
</body>
</html>
来源:oschina
链接:https://my.oschina.net/u/1754075/blog/686062