CSS Outline-width

Please Share On:

Definition:

Outline-width is used to set the outline thickness drawn around outside the border of an element. Its value can be specified into the px, in, cm, em, or so on.

Syntax:

outline-width: 5px;

Source Code:

<!DOCTYPE html>
<html>
<head>
<style>
.outline-width1{
  border: 5px solid red;
  outline: dashed;
  outline-color: green;
  outline-width: 5px;
  background-color: pink;
  text-align:center;
}
.outline-width2{
  border: 5px solid red;
  outline: dashed;
  outline-color: green;
  outline-width: 0.06in;
  background-color: pink;
  text-align:center;
}
.outline-width3{
  border: 5px solid red;
  outline: dashed;
  outline-color: green;
  outline-width: 0.5em;
  background-color: pink;
  text-align:center;
}
</style>
</head>
  
<body>
<div class="outline-width1">This is a first example where outline-width is specified in pixels (px).<br/>outline-width: 5px; </div> 
</p>

<div class="outline-width2">This is a second example where outline-width is specified in inches (in)<br/>outline-width: 0.06in; </div> 
</p>

<div class="outline-width3">This is a third example where outline-width is specified in em <br/>outline-width: 0.5em; </div> 
</body>
</html>

Output:



You may be interested in the following topics:

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright @2023. All Right Reserved.


Social media & sharing icons powered by UltimatelySocial