border-top-width
Description
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. |
Syntax and Property Values
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 |
Example
<!DOCTYPE HTML>
<html>
<head>
<style>
h2 {<!-- w w w . ja v a 2s . co m-->
border-top-width: 2px;
border-top-style: double;
}
</style>
</head>
<body>
<h2>This is the title</h2>
</body>
</html>
The code above generates the following result.