border-top-width - HTML CSS CSS Property

HTML CSS examples for CSS Property:border-top-width

Description

The border-top-width property sets the width of an element's top border.

The following table summarizes the border-top-width Property.

Item Value
Default value: medium
Applies to:All elements
Inherited: No
Animatable: Yes.

Syntax

The syntax of the property is as follows:


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

Property Values

The following table describes the values of this property.

Value Description
thinA thin border.
medium A medium border.
thick A thick border.
length A length value in px, pt, cm, em, etc. Negative values are not allowed.
initial Sets this property to its default value.
inherit take the value of its parent element border-top-width property.

The example below shows the border-top-width property.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html lang="en">
 <head>
  <title>Example of CSS border-top-width property</title>
  <style type="text/css">
    p {<!--from ww w  .  j a  v a 2 s.c  o  m-->
      border-style: solid;
      border-top-width: 15px;
    }
    </style>
 </head>
 <body>
  <p>This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. </p>
 </body>
</html>

Related Tutorials