Little Web Hut

CSS 2.1 Reference: border-top-width Property

CSS border-top-width Property
Syntax
selector {border-top-width: width;}
  • width is specified by using a length or one of the following keywords: thin, medium, thick, or inherit.
Usage

The border-top-width property is used to specify the width of the top border. See the Box Model for a description of the boxes that are generated for elements and the relative position of the borders.

This property is specified by using a length, or a keyword, according to the syntax shown above.


CSS Example: The border-top-width properties are set using a length for the <h1> element and a keyword for the <h2> element.
h1 {border: thin solid red;
    border-top-width: 20px;
}
h2 {border: thin solid red;
    border-top-width: thick;
}
Test It HTML StyleTest It XHTML StyleTest It HTML5 Style

Keywords
  • thin
  • medium
  • thick
  • inherit - The inherit keyword is used to specify that the value for this property should be taken from the parent element. If inherit is used with the root element, then the initial value for this property will be used.
Applies To All elements
Inherited No
Initial Value medium


border-top-width Property Examples
Test It HTML StyleTest It HTML StyleTest It HTML5 StyleThe border-top-width properties are set using a length for the <h1> element and a keyword for the <h2> element.