letter-spacing和word-spacing之间的区别
letter-spacing和word-spacing这两个属性都用来添加他们对应的元素中的空白。letter-spacing添加字母之间的空白,而word-spacing添加每个单词之间的空白。请大家注意,word-spacing对中文无效。
letter-spacing
语法:
letter-spacing : normal | length
参数:
normal : 默认间隔
length : 由浮点数字和单位标识符组成的长度值,允许为负值。请参阅长度单位
说明:
检索或设置对象中的文字之间的间隔。
该属性将指定的间隔添加到每个文字之后,但最后一个字将被排除在外。
对应的脚本特性为letterSpacing。
word-spacing
语法:
word-spacing : normal | length
参数:
normal : 默认间距
length : 由浮点数字和单位标识符组成的长度值,允许为负值。请参阅长度单位
说明:
检索或设置对象中的单词之间插入的空格数。对于IE4+而言仅在MAC平台上可用。
对应的脚本特性为wordSpacing。
letter-spacing与word-spacing有什么区别
word-spacing:设置元素文本的单词间的空白(即字间隔)。
letter-spacing:设置元素文本的字符间的空白(字符间距)。
letter-spacing和word-spacing这两个属性都用来添加它们对应的元素中的空白。letter-spacing添加字母之间的空白,而word-spacing添加每个单词之间的空白,word-spacing对中文无效。
以上资料来源:《HTML5布局之路》
css word-spacing 怎么用
word-spacing 属性增加或减少单词间的空白(即字间隔)。
该属性定义元素中字之间插入多少空白符。针对这个属性,“字” 定义为由空白符包围的一个字符串。
如果指定为长度值,会调整字之间的通常间隔;所以,normal 就等同于设置为 0。允许指定负长度值,这会让字之间挤得更紧。
例如下面的例子:
This is some text. This is some text.This is some text. This is some text.。css调整单词间距word-spacing怎么写代码呢
html xmlns=http://www。
w3。org/1999/xhtmlheadmeta http-equiv=Content-Type content=text/html; charset=utf-8 /title无标题文档/title/headstyle type=text/css。
s {font-family: 宋体;font-size: 18px;word-spacing: 3px;}/stylebody class=sLost time is never found again。 This is something which I learned very clearly last semester。
I spent so much time fooling around that my grades began to suffer。 I finally realized that something had to be done。
It was time for a change。 /body/html。
我在dreamweaver中对文本使用word-spacing属性为什么看不出效果的
word-spacing 属性增加或减少单词间的空白(即字间隔)。
该属性定义元素中字之间插入多少空白符。针对这个属性,“字” 定义为由空白符包围的一个字符串。如果指定为长度值,会调整字之间的通常间隔;所以,normal 就等同于设置为 0。允许指定负长度值,这会让字之间挤得更紧。
看效果:
This is some text. This is some text.
This is some text. This is some text.
<html>
<head>
<style type="text/css">
p.spread {word-spacing: 30px;}
p.tight {word-spacing: -0.5em;}
</style>
</head>
<body>
<p class="spread">This is some text. This is some text.</p>
<p class="tight">This is some text. This is some text.</p>
</body>
</html>
转载请注明出处51数据库 » word中的spacing