text-justify
text-justify 属性规定文本对齐设置为 “justify” 的理据。
此属性规定应怎样对齐文本以及对齐间距。
语法
text-justify: auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|trim;
值
值 | 描述 |
---|---|
auto | 浏览器决定齐行算法。 |
none | 禁用齐行。。 |
inter-word | 增加/减少单词间的间隔。 |
inter-ideograph | 用表意文本来排齐内容。 |
inter-cluster | 只对不包含内部单词间隔的内容(比如亚洲语系)进行排齐。 |
distribute | 类似报纸版面,除了在东亚语系中最后一行是不齐行的。 |
kashida | 通过拉伸字符来排齐内容。 |
例子
HTML
<h1>CSS text-justify实例</h1> <div>In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since. 'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.'</div> <p><b>提示:</b> 调整浏览器窗口的大小, 以查看“text-justify”如何工作</p> <p><b>注意:</b>text-justify 只兼容IE浏览器.</p>
CSS
div { text-align:justify; text-justify:inter-word; }
执行结果
CSS text-justify实例
In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since. 'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.'
提示: 调整浏览器窗口的大小, 以查看“text-justify”如何工作
注意:text-justify 只兼容IE浏览器.