css3的文本效果text-justify

来源:互联网 发布:水光面膜怎么样 知乎 编辑:程序博客网 时间:2024/06/06 20:40

<!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" /><style>div{text-align:justify;text-justify:distribute;}</style></head><body><h1>CSS text-justify 实例</h1><div>Shanghai is the largest city by population in the People's Republic of China (PRC) and the largest city proper by population in the world. It is one of the four province-level municipalities of the PRC, with a total population of over 23 million as of 2010. It is a global city, with influence in commerce, culture, finance, media, fashion, technology, and transport. It is a major financial center and the busiest container port in the world.</div><p><b>提示:</b>请调整浏览器窗口的大小,来查看齐行效果。</p><p><b>注释:</b>text-justify 属性只在 IE 中有效。</p></body></html>

引用w3school的例子

语法

text-justify: auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|trim;
值描述测试auto浏览器决定齐行算法。测试none禁用齐行。测试inter-word增加/减少单词间的间隔。测试inter-ideograph用表意文本来排齐内容。测试inter-cluster只对不包含内部单词间隔的内容(比如亚洲语系)进行排齐。测试distribute类似报纸版面,除了在东亚语系中最后一行是不齐行的。测试kashida通过拉伸字符来排齐内容。测试

调节浏览器窗口大小后的效果(个人实验text-justify:inter-word;在火狐上有效果,以上的那些没有效果):