border-top-width
sets the width for the top border.
Item | Value |
---|---|
Initial value | medium |
Inherited | No. |
Version | CSS1 |
JavaScript syntax | object.style.borderTopWidth="thick" |
Applies to | All elements. |
border-top-width: non-negative length | medium | thick | thin | inherit
The property values are listed in the following table.
Value | Description |
---|---|
thin | thin top border |
medium | medium top border. default |
thick | thick top border |
length | set the thickness of the top border |
inherit | inherit the border width from the parent element |
border-top-width |
Yes | Yes | Yes | Yes | Yes |
An example showing how to use border-top-width CSS property.
<!DOCTYPE HTML>
<html>
<head>
<style>
h2 {<!-- w ww. j a v a2 s.c om-->
border-top-width: 2px;
border-top-style: double;
}
</style>
</head>
<body>
<h2>This is the title</h2>
</body>
</html>