CSS - outline-width



Description

The outline-width property defines the width of the outline around an element.

Possible Values

  • length − Any length unit. Length units for this property may not be negative.

  • thin − An outline which is thinner than an outline set to medium.

  • medium − An outline which is thicker than an outline set to thin, and thinner than an outline set to thick.

  • thick − An outline which is thicker than an outline set to medium.

Applies to

All the HTML elements.

DOM Syntax

object.style.outlineWidth = "thin";

Example

Here is the example −

<html>
   <head>
   </head>
   <body>
      <p style = "outline-width: 5px; outline-style: solid;  padding: 10px">
        This text is with 5px outline around it.
      </p>
      <p style = "outline-width: thin; outline-style: solid; padding: 10px">
         This text is with thin outline around it.
      </p>
      <p style = "outline-width: medium; outline-style: solid;  padding: 10px">
         This text is with medium outline around it.
      </p>
      <p style = "outline-width: thick; outline-style: solid; padding: 10px">
         This text is with thick outline around it.
      </p>

   </body>
</html>
Advertisements