CSS Border Width

CSS Border Width


Border-Width Property 
CSS border-width property is used to define the width of the border of an element.
The width can be set to different sizes using the three basic values -
1. Thin
2. Medium 
3. Thick
Or width size can be given differently shown as below - 
1. px 
2. pt 
3. cm 
4. em etc
Where most commonly used ways are - thin, medium, thick, and px.
Now we will see examples - 
Example - 
<!DOCTYPE html>
<html lang="en">
<head>
    <style type="text/css">
p.one {
  border-style: solid;
  border-width: thin;
}

p.two {
  border-style: solid;
  border-width: medium;
}

p.three {
  border-style: dotted;
  border-width: thick;
}

p.four {
  border-style: dotted;
  border-width: 2px;
}
p.five {
  border-style: dotted;
  border-width: 6px;
}
        </style>
<link rel="stylesheet" href="sample.css">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1 class="fruit" style="color:black" >This is first Heading
    </h1>
    <p class="one">
this is an apple and an apple a day keeps doctor away
  </p>
    <p class="two">
this is an apple and an apple a day keeps doctor away
  </p>
    <p class="three">
this is an apple and an apple a day keeps doctor away
  </p>
    <p class="four">
this is an apple and an apple a day keeps doctor away
  </p>
</body>
</html>
Output -