This shorthand property sets the overall outline for an element.
Item | Value |
---|---|
Initial value | invert none medium |
Inherited | No. |
Version | CSS2 |
JavaScript syntax | object.style.outline="#FF00FF dotted thin" |
Applies to | All elements. |
outline: outline-color outline-style outline-width;
The property values are listed in the following table.
Value | Description |
---|---|
outline-color | Set the color |
outline-style | Set the style |
outline-width | Set the width |
inherit | Inherit the value of the outline property from the parent element |
outline |
Yes | 8.0 | Yes | Yes | Yes |
An example showing how to use outline CSS property.
<!DOCTYPE html>
<html>
<head>
<style>
p{<!-- w ww . j av a 2 s . com-->
border:1px solid red;
outline:green dotted thick;
}
</style>
</head>
<body>
<p>paragraph</p>
</body>
</html>