Style borderWidth Property
Style borderWidth Property
The borderWidth property is used to either set or return the width of an element border. It has the following types:-
- One value specifies border width for all four sides.
- Two values will specify one border width for top and bottom borders and the other width for the left and right borders.
- Three values will specify the first width for the top border, a second width for the left and right borders, and third width for the bottom border.
- Four values will specify the width for all four sides from the top, right, bottom, and left sides of the borders.
Syntax:-
Its syntax is:- object.style.borderWidth OR object.style.borderWidth = thin|medium|thick|length|initial|inherit
Return:-
Its return is:- string having width of an element border
Further Explanation:-
Value | Description |
---|---|
thin | Defines thin border. |
medium | Defines medium border. |
thick | Defines thick border. |
length | The width of the border in length units. |
initial | Sets property to its default value. |
inherit | Inherits property from its parent element. |