word-spacing - CSS(层叠样式表) 编辑
Summary
属性
word-spacing
用于声明标签和单词直接的间距行为。
初始值 | normal |
---|---|
适用元素 | all elements. It also applies to ::first-letter and ::first-line . |
是否是继承属性 | yes |
Percentages | refer to the width of the affected glyph |
适用媒体 | visual |
计算值 | an optimum, minimum, and maximum value, each consisting of either an absolute length, a percentage, or the keyword normal |
Animation type | a length |
正规顺序 | the unique non-ambiguous order defined by the formal grammar |
Syntax
word-spacing: normal; /* Keyword value */
word-spacing: 3px; /* <length> values */
word-spacing: 0.3em;
word-spacing: inherit;
Values
normal
- 正常的单词间距,由当前字体和/或浏览器定义。
<length>
- 通过指定具体的额外间距来增加字体的单词间距。查看
<length>
了解可用单位。 <percentage>
- 通过指定受影响字符的宽度的百分比的方式来增加的间距。
Formal syntax
normal | <length-percentage>where
<length-percentage> = <length> | <percentage>
Examples
以下 CSS 代码:
#mozdiv1 {
word-spacing: 15px;
}
#mozdiv2 {
word-spacing: 5em;
}
会为两个包含如下内容 <div>
标签添加如下样式:
Specifications
Specification | Status | Comment |
---|---|---|
CSS Text Module Level 3 word-spacing | Working Draft | Replace the previous values with a<spacing-limit> value that defines the same value, plus the<percentage> value and allows up to three values describing the optimum, minimum, and maximum value. |
CSS Transitions word-spacing | Working Draft | Defines word-spacing as animatable. |
CSS Level 2 (Revision 1) word-spacing | Recommendation | No change. |
CSS Level 1 word-spacing | Recommendation | Initial specification. |
Browser compatibility
We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 1.0 | 1.0 (1.7 or earlier) | 6.0 | 3.5 | 1.0 (85) |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | ? | ? | ? | ? | ? |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论