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

CSS border-width property


May 05, 2021 CSS Reference Manual


Table of contents


CSS border-width property


Set the width of the four borders:

P
{
border-style:solid;
border-width:15px;
}

Try it out . . .

Description of property definition and use

The border-width property sets the width of the four borders of an element. This property can have one to four values.

Instance:

border-width:thin medium thick 10px;

  • The top border is a thin border
  • The right border is a medium border
  • The bottom border is a thick border
  • The left border is a 10px wide border

border-width:thin medium thick;

  • The top border is a thin border
  • The right and left borders are medium borders
  • The bottom border is a thick border

border-width:thin medium;

  • The top and bottom borders are thin borders
  • The right and left borders are medium borders

border-width:thin;

  • All 4 borders are thin borders
Default: medium
Inheritance: no
Version: CSS1
JavaScript syntax: object .style.borderWidth="thin thick"


Browser support

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

Attributes
border-width 1.0 4.0 1.0 1.0 3.5

The property value

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


Related articles

CSS tutorial: CSS Border