Search within TutorialsPark

CSS border-top-width Property


To set the width of the top edge of the border


Definition and Notes.

1. The CSS border-top-width property sets the width of the top edge of the border

2. The border-style must be declared before specfying the border-top-width , as you cannot have border width without having a border.


Syntax:

CSS border-left-width property. internetexplorer safari firefox opera chrome

View in Splitscreen»

Code-Editor:

Note- Should be used only when specific styling of the border is required

Property Values

Value Description
thin Sets a thin top border
medium Sets a medium width top border. Its the default value.
thick Sets a thick top border.
length To set the top border width using length values(px and em).
inherit The width of the top border is inherited from the parent element.

Specifications

Specs Value
Name border-top-width
Value thin | medium | thick | length | inherit
Initial Value medium
Applies to all elements.
Javascript syntax object.style.borderTopWidth=" 15px "
Inherited No
Computed Value Absolute length; 0 if the style of the border is none or hidden
Browser Support internetexplorer safari firefox opera chrome

Related Examples.