CSS border-top-width Property

CSS border-top-width Property


CSS border-top-width Property
This property sets the width of an element’s top border. 
Syntax -
border-top-width: non-negative length | medium | thick | thin | inherit 
 
Now we will see the values used for the property with their description given below -
Value
Description
medium
Specifies a medium top border, and it is default value
thin
Specifies a thin top border
thick
Specifies a thick top border
length
Allows to define the thickness of the top border.
 
Now we will see an Example -
Example -
<!DOCTYPE html>
<html>

<head>
    <style>
        .low {
            border: 3px solid black;
            border-top-width: thick;
        }

        p {
            border: 3px solid black;

            border-top-width: 15px;
        }
    </style>
</head>

<body>

  <h1 class="low">This is a heading</h1>

  <p>This is a sample pera</p>
</body>

</html
Output -