outline-width

  • Revision slug: Web/CSS/outline-width
  • Revision title: outline-width
  • Revision id: 446687
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

Summary

The outline-width CSS property is used to set the width of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out:

{{cssbox("outline-width")}}

Syntax

Formal syntax: {{csssyntax("outline-width")}}
outline-width: thin
outline-width: medium
outline-width: thick

outline-width: 1px     /* <length> values */
outline-width: 0.1em

outline-width: inherit
</length>

Values

thin
Depends on the UA. Typically 1px in desktop browsers like Firefox.
medium
Depends on the UA. Typically 3px in desktop browsers like Firefox.
thick
Depends on the UA. Typically 5px in desktop browsers like Firefox.
<length>
See {{ Xref_csslength() }} values.

Examples

thin   medium    thick    2px    1ex      2em

Specifications

Specification Status Comment
{{ SpecName('CSS3 UI', '#outline-width', 'outline-width') }} {{ Spec2('CSS3 UI') }} No change.
{{ SpecName('CSS3 Transitions', '#animatable-css', 'outline-width') }} {{ Spec2('CSS3 Transitions') }} Defines outline-width as animatable.
{{ SpecName('CSS2.1', 'ui.html#propdef-outline-width', 'outline-width') }} {{ Spec2('CSS2.1') }}  

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support  1.0 1.5 (1.8) [*] 8.0 7.0 1.2 (125)
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

In browsers previous to Gecko 1.8 (Firefox 1.5) essentially the same effect can be achieved using Mozilla CSS Extension {{ Cssxref("-moz-outline-width") }}.

See also

  • {{ CSS_Reference:Outline() }}

Revision Source

<p>{{ CSSRef() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>outline-width</code> CSS property is used to set the width of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out:</p>
<p>{{cssbox("outline-width")}}</p>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="twopartsyntaxbox">
<a href="/en-US/docs/CSS/Value_definition_syntax" title="CSS/Value_definition_syntax">Formal syntax</a>: {{csssyntax("outline-width")}}
</pre>
<pre>
outline-width: thin
outline-width: medium
outline-width: thick

outline-width: 1px     /* <length> values */
outline-width: 0.1em

outline-width: inherit
</length></pre>
<h3 id="Values">Values</h3>
<dl>
  <dt>
    <code>thin</code></dt>
  <dd>
    Depends on the UA. Typically <strong>1px</strong> in desktop browsers like Firefox.</dd>
  <dt>
    <code>medium</code></dt>
  <dd>
    Depends on the UA. Typically <strong>3px</strong> in desktop browsers like Firefox.</dd>
  <dt>
    <code>thick</code></dt>
  <dd>
    Depends on the UA. Typically <strong>5px</strong> in desktop browsers like Firefox.</dd>
  <dt>
    <code>&lt;length&gt;</code></dt>
  <dd>
    See {{ Xref_csslength() }} values.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre>
<span style="outline:solid thin">thin</span>   <span style="outline:solid medium">medium</span>    <span style="outline:solid thick">thick</span>    <span style="outline:solid 2px">2px</span>    <span style="outline:solid 1ex">1ex</span>      <span style="outline:solid 2em">2em</span></pre>
<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 UI', '#outline-width', 'outline-width') }}</td>
      <td>{{ Spec2('CSS3 UI') }}</td>
      <td>No change.</td>
    </tr>
    <tr>
      <td>{{ SpecName('CSS3 Transitions', '#animatable-css', 'outline-width') }}</td>
      <td>{{ Spec2('CSS3 Transitions') }}</td>
      <td>Defines <code>outline-width</code> as animatable.</td>
    </tr>
    <tr>
      <td>{{ SpecName('CSS2.1', 'ui.html#propdef-outline-width', 'outline-width') }}</td>
      <td>{{ Spec2('CSS2.1') }}</td>
      <td>&nbsp;</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 (WebKit)</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>&nbsp;1.0</td>
        <td>1.5 (1.8) [*]</td>
        <td>8.0</td>
        <td>7.0</td>
        <td>1.2 (125)</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&nbsp;Phone</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>
<p>In browsers previous to <a href="/en/Gecko" title="en/Gecko">Gecko</a> 1.8 (<a href="/en/Firefox_1.5_for_developers" title="en/Firefox_1.5_for_developers">Firefox 1.5</a>) essentially the same effect can be achieved using <a href="/en/CSS/CSS_Reference/Mozilla_Extensions" title="en/CSS_Reference/Mozilla_Extensions">Mozilla CSS Extension</a> {{ Cssxref("-moz-outline-width") }}.</p>
<h2 id="See_also">See also</h2>
<ul>
  <li>{{ CSS_Reference:Outline() }}</li>
</ul>
Revert to this revision