outline

Description

This shorthand property sets the overall outline for an element.

ItemValue
Initial value invert none medium
Inherited No.
Version CSS2
JavaScript syntax object.style.outline="#FF00FF dotted thin"
Applies to All elements.

Syntax and Property Values


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

Example


<!DOCTYPE html>
<html>
<head>
<style>
p{<!--from  w w w.  j a v  a  2 s.co m-->
    border:1px solid red;
    outline:green dotted thick;
}
</style>
</head>

<body>
    <p>paragraph</p>
</body>
</html>

Click to view the demo

The code above generates the following result.

outline




















Home »
  HTML CSS »
    HTML CSS Reference »




HTML Tag Reference
CSS Reference
CSS Selector Reference
Encoding Reference