Change the width of the top border of a <div> element to 10px:
The borderTopWidth property sets or returns the width of the top border of an element.
The borderTopWidth property is supported in all major browsers.
Return the borderTopWidth property:
Set the borderTopWidth property:
Value | Description |
---|---|
thin | Defines a thin border |
medium | Defines a medium border. This is default |
thick | Defines a thick border |
length | The width of the border in length units |
inherit | The width of the top border is inherited from the parent element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | medium |
---|---|
Return Value: | A String, representing the width of an element's top border |
CSS Version | CSS1 |
Change the width of the top border of a <div> element to thin:
Return the width of the top border of a <div> element:
CSS tutorial: CSS Border
CSS reference: border-top-width property
HTML DOM reference: border property