Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS border-width property

CSS border-width property

Example

Set the widths of the four borders:

p

{

border-style:

solid

;

border-width:

15

px

;

}

Try it »


Property definition and usage

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

Example:

**border-width:thin medium thick 10px; **

border-width:thin medium thick;

border-width:thin medium;

border-width:thin;

Default value: medium
Inheritance: no
Version: CSS1
JavaScript syntax: object.style.borderWidth="thin thick"

Browser support

The numbers in the table indicate the first browser version that supports this property.

property
border-width 1.0 4.0 1.0 1.0 3.5

Attribute values

Value Description
thin Defines a thin border.
medium Default. Defines a medium border.
thick Defines 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