Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

CSS border-top-width property


May 05, 2021 CSS Reference Manual


Table of contents


CSS border-top-width property


Set the width of the top border:

p
{
border-style:solid;
border-top-width:15px;
}

Try it out . . .

Description of property definition and use

The border-top-width property sets the width of the top border of an element.

Note: Always declare the border-style property before the border-top-width property. An element can only change the width of its border after it is obtained.

Default: medium
Inherited: no
Version: CSS1
JavaScript syntax: object object.style.borderTopWidth="thick"


Browser support

The numbers in the table support the first browser version number of the property.

Attributes
border-top-width 1.0 4.0 1.0 1.0 3.5

The property value

Value Describe
thin Defines the thin top border.
medium The default. Define a medium top border.
thick Defines a thick top border.
length Allows you to customize the width of the top border.
inherit Specifies that the border width should be inherited from the parent element.


Related articles

CSS tutorial: CSS Border

CSS Reference Manual: Border-top Property