word-spacing

  • Revision slug: CSS/word-spacing
  • Revision title: word-spacing
  • Revision id: 326019
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

Summary

The word-spacing CSS property specifies spacing behavior between tags and words.

  • {{ Xref_cssinitial() }} {{ Cssxref("normal") }}
  • Applies to all elements
  • {{ Xref_cssinherited() }} yes
  • Media {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }} for normal the value 0; otherwise the absolute length

Syntax

word-spacing:  normal | <length>

Values

normal
The normal inter-word space, as defined by the current font and/or the browser.
<length>
See {{ Xref_csslength() }} value for possible units.

Examples

The following CSS code:

#mozdiv1 {
  word-spacing: 15px;
}

#mozdiv2 {
  word-spacing: 5em;
}

will style two {{ HTMLElement("div") }} tags containing text as shown here:

example.png

Specifications

Specification Status Comment
{{ SpecName('CSS3 Text', '#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 visibility 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.

Browser compatibility

{{ 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() }}

See also

  • {{ CSS_Reference:Text() }}

Revision Source

<p>{{ CSSRef() }}</p>
<h2 id="Summary" name="Summary">Summary</h2>
<p>The <code>word-spacing</code> CSS property specifies spacing behavior between tags and words.</p>
<ul class="cssprop">
  <li><dfn>{{ Xref_cssinitial() }}</dfn> {{ Cssxref("normal") }}</li>
  <li><dfn>Applies to</dfn> all elements</li>
  <li><dfn>{{ Xref_cssinherited() }}</dfn> yes</li>
  <li><dfn>Media</dfn> {{ Xref_cssvisual() }}</li>
  <li><dfn>{{ Xref_csscomputed() }}</dfn> for <code>normal</code> the value <code>0</code>; otherwise the absolute length</li>
</ul>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">
word-spacing:  normal | &lt;length&gt;
</pre>
<h3 id="Values" name="Values">Values</h3>
<dl>
  <dt>
    <code>normal</code></dt>
  <dd>
    The normal inter-word space, as defined by the current font and/or the browser.</dd>
  <dt>
    <code>&lt;length&gt;</code></dt>
  <dd>
    See {{ Xref_csslength() }} value for possible units.</dd>
</dl>
<h2 id="Examples" name="Examples">Examples</h2>
<p>The following CSS code:</p>
<pre class="brush: css">
#mozdiv1 {
  word-spacing: 15px;
}

#mozdiv2 {
  word-spacing: 5em;
}</pre>
<p>will style two {{ HTMLElement("div") }} tags containing text as shown here:</p>
<p><img alt="example.png" class="internal default" src="/@api/deki/files/6103/=example.png" /></p>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('CSS3 Text', '#word-spacing', 'word-spacing') }}</td>
      <td>{{ Spec2('CSS3 Text') }}</td>
      <td>Replace the previous values with a <code>&lt;spacing-limit&gt;</code> value that defines the same value, plus the <code>&lt;percentage&gt;</code> value and allows up to three values describing the optimum, minimum, and maximum value.</td>
    </tr>
    <tr>
      <td>{{ SpecName('CSS3 Transitions', '#animatable-css', 'word-spacing') }}</td>
      <td>{{ Spec2('CSS3 Transitions') }}</td>
      <td>Defines <code>visibility</code> as animatable.</td>
    </tr>
    <tr>
      <td>{{ SpecName('CSS2.1', 'text.html#propdef-word-spacing', 'word-spacing') }}</td>
      <td>{{ Spec2('CSS2.1') }}</td>
      <td>No change.</td>
    </tr>
    <tr>
      <td>{{ SpecName('CSS1', '#word-spacing', 'word-spacing') }}</td>
      <td>{{ Spec2('CSS1') }}</td>
      <td>Initial specification.</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>1.0</td>
        <td>{{ CompatGeckoDesktop("1.0") }}</td>
        <td>6.0</td>
        <td>3.5</td>
        <td>1.0 (85)</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
        <td>{{ CompatUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li>{{ CSS_Reference:Text() }}</li>
</ul>
Revert to this revision