ScanSkill

border-width

The border-width property defines the width of four borders of an element. It accepts one to four values.

Syntax

border-width: medium | thin | thick | value;

One value:

border-width: 1px;

This value applies to all four borders.

Two values:

border-width: 1px 5px;

The first value, 1px applies to the top and bottom borders, and the second value, 5px applies to the left and right borders of an element.

Three values:

border-width: 1px thin 3px;

The first value, 1px applies to the top border, the second value, thin applies to the right and left borders, and the third value, 3px applies to the bottom border.

Four values:

border-width: 1px thin 3px 5px;

The first value, 1px applies to the top border, the second value, thin applies to the right border, the third value, 3px applies to the bottom border and the fourth value, 5px applies to the left border.

Example

.mydiv{
	border-width: 1px;
	border-color: black;
}

.div2{
	border-width: thin 2px;
	border-color: red;
}

Property Values

value: sets a thickness of a given value to the border.

medium: sets a medium border*. (default value)*

thin: sets a thin border.

thick: sets a thick border.