CSS border-top-width Property

CSS border-top-width property sets the border top width of an element.


The following table outline the usages and version history of this property.

Default value: medium
Applies to: All elements
Inherited: No
Version: CSS1
JavaScript Syntax: object.style.borderTopWidth = "2px"


Here is a syntax for the CSS border-top-width property

border-top-width: medium | thin |thick | length | initial | inherit;

Property Values

The following table describes the values of this property.

Value Description
medium Default. Set a medium border
thin Set a thin border
thick Set a thick border
length Set length value in px, pt, cm, em, etc that define border thickness
initial Sets default value of this property
inherit Inherits this property from its parent element


The example below shows to sets border top width.

.border-1 {
  border-top-width: medium;
.border-2 {
  border-top-width: thin;
.border-3 {
  border-top-width: thick;
.border-4 {
  border-top-width: 5px;

Run it...   »

Browser Compatibility

  • Google Chrome 1+
  • Mozilla Firefox 1+
  • Internet Explorer 4+
  • Opera 3.5+
  • Safari 1+

Note: Here details of browser compatibility with version number may be this is bug and not supported. But recommended to always use latest Web browser.