outline

  • Revision slug: CSS/outline
  • Revision title: outline
  • Revision id: 25522
  • Created:
  • Creator: BijuGC
  • Is current revision? No
  • Comment /* Summary */

Revision Content

{{template.CSSRef()}}

Summary

The outline property is a shorthand property for setting the individual outline property values in a single place in the style sheet. outline can be used to set the values for one or more of: {{template.Cssxref("outline-width")}}, {{template.Cssxref("outline-style")}}, {{template.Cssxref("outline-color")}}.

  • Initial value: see individual properties for details
  • Applies to: all elements
  • Inherited: no
  • Percentages: N/A
  • Media: visual interactive
  • Computed value: see individual properties

In browsers previous to Gecko 1.8 (Firefox 1.5) webdeveloper could archive same effect by using Mozilla CSS Extension {{template.Cssxref("-moz-outline")}} .

Syntax

outline: [outline-width || outline-style || outline-color | inherit] ;

Values

border-width
See {{template.Cssxref("outline-width")}}.
border-style 
See {{template.Cssxref("outline-style")}}.
border-color 
See {{template.Cssxref("outline-color")}}.

Examples

{{template.CSSRefExampleLink("outline")}}

element { 
    outline: 1px solid #000;
}

Notes

While the {{template.Cssxref("outline-width")}}, {{template.Cssxref("outline-style")}}, and {{template.Cssxref("outline-color")}} properties accept up to four values, this property only accepts one value for each property.

Specifications

Browser compatibility

Browser Lowest Version
Internet Explorer ?
Firefox ?
Netscape ?
Opera ?

See also

{{wiki.template('CSS_Reference:Outline')}}

Revision Source

<p> 
{{template.CSSRef()}}
</p>
<h3 name="Summary"> Summary </h3>
<p>The <code>outline</code> property is a shorthand property for setting the individual outline property values in a single place in the style sheet.  <code>outline</code> can be used to set the values for one or more of: {{template.Cssxref("outline-width")}}, {{template.Cssxref("outline-style")}}, {{template.Cssxref("outline-color")}}.
</p>
<ul><li> Initial value: see individual properties for details
</li><li> Applies to: all elements
</li><li> Inherited: no
</li><li> Percentages: N/A
</li><li> Media: <a href="en/CSS/Media/Visual">visual</a>  <a href="en/CSS/Media/Interactive">interactive</a>
</li><li> Computed value: see individual properties
</li></ul>
<p>In browsers previous to <a href="en/Gecko">Gecko</a> 1.8 (<a href="en/Firefox_1.5">Firefox 1.5</a>) webdeveloper could archive same effect by using <a href="en/CSS_Reference/Mozilla_Extensions">Mozilla CSS Extension</a> {{template.Cssxref("-moz-outline")}} .
</p>
<h3 name="Syntax"> Syntax </h3>
<pre class="eval">outline: [<i>outline-width</i> || <i>outline-style</i> || <i>outline-color</i> | <i>inherit</i>] ;
</pre>
<h3 name="Values"> Values </h3>
<dl><dt> border-width</dt><dd> See {{template.Cssxref("outline-width")}}.
</dd><dt> border-style </dt><dd> See {{template.Cssxref("outline-style")}}.
</dd><dt> border-color </dt><dd> See {{template.Cssxref("outline-color")}}.
</dd></dl>
<h3 name="Examples"> Examples </h3>
<p>{{template.CSSRefExampleLink("outline")}}
</p>
<pre>element { 
    outline: 1px solid #000;
}
</pre>
<h3 name="Notes"> Notes </h3>
<p>While the {{template.Cssxref("outline-width")}}, {{template.Cssxref("outline-style")}}, and {{template.Cssxref("outline-color")}} properties accept up to four values, this property only accepts one value for each property.
</p>
<h3 name="Specifications"> Specifications </h3>
<ul><li> <a class="external" href="http://www.w3.org/TR/CSS1#border">CSS 1</a>
</li><li> <a class="external" href="http://www.w3.org/TR/CSS21/box.html#box-border-area">CSS 2.1</a>
</li><li> <a class="external" href="http://www.w3.org/TR/css3-background/#the-border-shorthands">CSS 3</a>
</li></ul>
<h3 name="Browser_compatibility"> Browser compatibility </h3>
<table class="standard-table">
  <tbody><tr>
    <th>Browser</th>
    <th>Lowest Version</th>
  </tr>
  <tr>
    <td>Internet Explorer</td>
    <td>?</td>
  </tr>
  <tr>
    <td>Firefox</td>
    <td>?</td>
  </tr>
  <tr>
    <td>Netscape</td>
    <td>?</td>
  </tr>
  <tr>
    <td>Opera</td>
    <td>?</td>
  </tr>
</tbody></table>
<h3 name="See_also"> See also </h3>
<p>{{wiki.template('CSS_Reference:Outline')}}
</p>
Revert to this revision