word-break 说明

word-break 属性, 指定行的换行方式 。<规定自动换行的处理方法。> ※CJK 中日韩统一表意文字(CJK Unified Ideographs),目的是要把分别来自中文、日文、韩文、越文中,本质、意义相同、形状一样或稍异的表意文字(主要为汉字,但也有仿汉字如日本国字、韩国独有汉字、越南的喃字)于ISO 10646及Unicode标准内赋予相同编码。CJK 是中文(Chinese)、日文(Japanese)、韩文(Korean)三国文字的缩写。顾名思义,它能够支持这三种文字。实际上,CJK 能够支持在 LaTeX 中使用包括中文、日文、韩文在内的多种亚洲双字节文字。

属性值

normal CJK 严格执行换行,非CJK根据自身的规定进行换行(默认值)<使用浏览器默认的换行规则。> keep-all CJK不进行换行,非CJK状态同normal <只能在半角空格或连字符处换行。> loose CJK换行比normal要求的弱, 非CJK状态同normal break-strict CJK的状态同normal相同,非CJK什么情况下都可以换行 break-all CJK的状态同loose相同,非CJK的状态与break-strict相同 <允许在单词内换行。>
※<>内容为其他网站转载内容 实例代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> word-break </title>
<style>
p.sample1 , p.sample2 , p.sample3 , p.sample4 , p.sample5 {
width:40px; margin-right:50px; background-color:yellow;
float:left;
}
p.sample1 {word-break:normal;}
p.sample2 {word-break:keep-all;}
p.sample3 {word-break:loose;}
p.sample4 {word-break:break-strict;}
p.sample5 {word-break:break-all;}

div.sample0 {clear:both;}
</style>

</head>

<body>
<div class="sample0">从左开始指定 normal、keep-all、loose、break-strict、break-all</div>

<p class="sample1">床前明月光,疑是地上霜,举头望明月,低头思故乡。</p>
<p class="sample2">床前明月光,疑是地上霜,举头望明月,低头思故乡。</p>
<p class="sample3">床前明月光,疑是地上霜,举头望明月,低头思故乡。</p>
<p class="sample4">床前明月光,疑是地上霜,举头望明月,低头思故乡。</p>
<p class="sample5">床前明月光,疑是地上霜,举头望明月,低头思故乡。</p>

<div class="sample0">从左开始指定 normal、keep-all、loose、break-strict、break-all を指定</div>

<p class="sample1">I have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by their character.</p>
<p class="sample2">I have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by their character.</p>
<p class="sample3">I have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by their character.</p>
<p class="sample4">I have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by their character.</p>
<p class="sample5">I have a dream that my four little children will one day live in a nation where they will not be judged by the color of their skin but by their character.</p>

<div class="sample0">从左开始指定 normal、keep-all、loose、break-strict、break-all</div>
</body>
</html>
实例图 word-break
更多技术问题,可以访问我的技术论坛 也可以回到CSS3参数表查找其他内容