649pages on
this wiki
Add New Page
Comments0 Share

The outline property is used in CSS and certain HTML elements. It creates an outline around the selected object, rendering each side the same as the others. A background-color is not necessary for this property to work. The padding property can also be used to specify the outline wrapping around the text.


  • <outline-width> - Any of the values for the outline-width property can be used to specify the thickness of the outline.
  • <outline-style> - Any of the values for the outline-style property can be used to specify the linetype of the outline.
  • <outline-color> - Any of the values for the outline-color property can be used to specify the color of the outline.

HTML example:

<span style="outline:thin solid black;">Outline this text</span>

That produces: outline this text

CSS example:

h1 {
    outline:5px solid black;

Firefox 1.5

This obsolete, browser-specific property is not recommended. Authors should generally find an alternative way to accomplish the same task while adhering to all best practices, or simply do without it if it is unimportant.

The CSS -moz-outline property was a Mozilla extension used in Firefox 1.5 and before as a substitute for the standard outline property, which is now fully supported.

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.