CSS3 text-justify 属性 | CSS3教程:CSS3 文本效果

返回到:CSS3 文本效果 | CSS3教程

属性定义及使用说明

text-justify属性指定文本对齐设置为”justify”的理据。

此属性指定应怎样对齐文本以及对齐间距。

默认值:auto
继承:yes
版本:CSS3
JavaScript 语法:object.style.textJustify=”inter-word”

语法

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

浏览器支持

表格中的数字表示支持该属性的第一个浏览器版本号。

属性谷歌IE火狐苹果opera
text-justify不支持5.5不支持不支持不支持

实例

改变字与字之间的间距使得每行对齐:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>Web176教程网(web176.com)</title>
<style>
div
{
	text-align:justify;
	text-justify:inter-word;
}
</style>
</head>

<body>
<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>
</body>

</html>

作者:terry,如若转载,请注明出处:https://www.web176.com/css3textpro/5157.html

(0)
打赏 支付宝 支付宝 微信 微信
terryterry
上一篇 2022年1月17日 下午4:18
下一篇 2022年1月17日 下午5:16

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注