Set the style of an outline:
An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".
The outline-style property specifies the style of an outline.
| Default value: | none |
|---|---|
| Inherited: | no |
| Version: | CSS2 |
| JavaScript syntax: | object.style.outlineStyle="dotted" |
![]()
The outline-style property is supported in all major browsers.
Note: IE8 supports the outline-style property only if a !DOCTYPE is specified.
An outline is a line around an element. It is displayed around the margin of the element. However, it is different from the border property.
The outline is not a part of the element's dimensions, therefore the element's width and height properties do not contain the width of the outline.
| Value | Description | Play it |
|---|---|---|
| none | Specifies no outline | Play it » |
| dotted | Specifies a dotted outline | Play it » |
| dashed | Specifies a dashed outline | Play it » |
| solid | Specifies a solid outline | Play it » |
| double | Specifies a double outliner | Play it » |
| groove | Specifies a 3D grooved outline. The effect depends on the outline-color value | Play it » |
| ridge | Specifies a 3D ridged outline. The effect depends on the outline-color value | Play it » |
| inset | Specifies a 3D inset outline. The effect depends on the outline-color value | Play it » |
| outset | Specifies a 3D outset outline. The effect depends on the outline-color value | Play it » |
| inherit | Specifies that the outline style should be inherited from the parent element |
Set the style of an outline
This example demonstrates how to set the style of an outline.
CSS tutorial: CSS Outline
CSS reference: outline property
HTML DOM reference: outlineStyle property
Complete CSS Reference
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|