By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

CSS Border-top-width Property

Reference on the CSS Border-top-width Property.

Edited: 2015-12-09 14:54

The border-top-width property of CSS is used to control the the width of the top-border in a HTML element.

div {
  border-top-width: 1px;

Typically you would also set the border-top-style and border-top-color when setting the style of the top border on its own.

Possible Values

Read Units of Measurement to understand the values

Inherited? NO!

Border-top-width example

When setting the border-top-width property, you will typically also be setting a few other properties. I.e.:

.text {
 border:1px solid black;
 border-top-radius:15px 10px;

In this example, we have first declared a general border style using the border shorthand, which will match all four borders. We have then overwritten the general style, with the more specific border-top-width declaration.