Style outlineWidth attribute
- Föregående sida outlineStyle
- Nästa sida overflow
- Åter till föregående nivå HTML DOM Style-objekt
Definition and usage
outlineWidth
Sets or returns the width of the outline around the element.
The outline is a line around the element. It is displayed around the element's margin. However, it is different from the border property.
The outline is not part of the element's size, so the width and height attributes do not include the outline width.
See also:
CSS Tutorial:CSS-kontur
CSS Reference Manual:outline property
HTML DOM Reference Manual:outline property
Example
Example 1
Change the outline width of the <div> element:
document.getElementById("myDiv").style.outlineWidth = "10px";
Example 2
Use the "thick" value to change the outline width of the <div> element:
document.getElementById("myDiv").style.outlineWidth = "thick";
Example 3
Return the width of the <div> element's outline:
alert(document.getElementById("myDiv").style.outlineWidth);
Syntax
Return outlineWidth attribute:
object.style.outlineWidth
Set outlineWidth attribute:
object.style.outlineWidth = "thin|medium|thick|length|initial|inherit"
Attribute value
Value | Description |
---|---|
thin | Define thin outline. |
medium | Define medium outline. Default. |
thick | Define thick outline. |
length | Outline width in length units. |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical details
Default value: | medium |
---|---|
Return value: | String representing the width of the element's outline. |
CSS version: | CSS2 |
Webbläsarstöd
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Stöd | Stöd | Stöd | Stöd | Stöd |
- Föregående sida outlineStyle
- Nästa sida overflow
- Åter till föregående nivå HTML DOM Style-objekt