--- title: word-spacing slug: Web/CSS/word-spacing translation_of: Web/CSS/word-spacing ---
{{ CSSRef() }}
属性
word-spacing
用于声明标签和单词直接的间距行为。
{{cssinfo}}
word-spacing: normal; /* Keyword value */
word-spacing: 3px; /* <length> values */
word-spacing: 0.3em;
word-spacing: inherit;
normal
<length>
<percentage>
{{csssyntax("word-spacing")}}
以下 CSS 代码:
#mozdiv1 {
word-spacing: 15px;
}
#mozdiv2 {
word-spacing: 5em;
}
会为两个包含如下内容 {{ HTMLElement("div") }} 标签添加如下样式:
Specification | Status | Comment |
---|---|---|
{{ SpecName('CSS3 Text', '#propdef-word-spacing', 'word-spacing') }} | {{ Spec2('CSS3 Text') }} | 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. |
{{ SpecName('CSS3 Transitions', '#animatable-css', 'word-spacing') }} | {{ Spec2('CSS3 Transitions') }} | Defines word-spacing as animatable. |
{{ SpecName('CSS2.1', 'text.html#propdef-word-spacing', 'word-spacing') }} | {{ Spec2('CSS2.1') }} | No change. |
{{ SpecName('CSS1', '#word-spacing', 'word-spacing') }} | {{ Spec2('CSS1') }} | Initial specification. |
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | 1.0 | {{ CompatGeckoDesktop("1.0") }} | 6.0 | 3.5 | 1.0 (85) |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} | {{ CompatUnknown() }} |