CSS bordertopwidth Property (original) (raw)

CSS border-top-width Property

Last Updated : 11 May, 2026

The border-top-width property in CSS is used to specify the width (thickness) of the top border of an element. It controls how thick or thin the top border appears.

**Syntax:

border-top-width: length | thin | medium | thick | initial | inherit;

**Default Value: medium

**Property Values: The border-top-width property values are listed below:

**Example: Here, we are using the above-explained property.

HTML `

border-top-width property
<style>
    #thin {
        border-color: green;
        border-top-style: solid;
        border-top-width: thin;
    }

    #medium {
        border-color: green;
        border-top-style: solid;
        border-top-width: medium;
    }

    #thick {
        border-color: green;
        border-top-style: solid;
        border-top-width: thick;
    }

    #length {
        border-color: green;
        border-top-style: solid;
        border-top-width: 20px;
    }

    #initial {
        border-color: green;
        border-top-style: solid;
        border-top-width: initial;
    }
</style>
<h1 style="color:green">GeeksforGeeks</h1>

<h3>border-top-width property</h3>

<div id="thin">
    border-top-width: thin;
</div><br><br>

<div id="medium">
    border-top-width: medium;
</div><br><br>

<div id="thick">
    border-top-width: thick;
</div><br><br>

<div id="length">
    border-top-width: length;
</div><br><br>

<div id="initial">
    border-top-width: initial;
</div>

`

**Output: