CSS border-top-width 属性
- previous page border-top-style
- Επόμενη Σελίδα border-width
Definition and Usage
The border-top-width property sets the width of the top border of an element.
This property only takes effect when the border style is not none. If the border style is none, the border width is actually reset to 0. Negative length values are not allowed.
Note:Always declare the border-style property before the border-top-width property. The element must have a border before its border width can be changed.
See Also:
CSS Tutorial:CSS Κάθετη Περιθωρία
CSS Reference Manual:border-top Property
HTML DOM Reference Manual:borderTopWidth Property
Example
Set the width of the top border:
p { border-style:solid; border-top-width:15px; }
CSS Syntax
border-top-width: medium|thin|thick|length|initial|inherit;
Property Value
Value | Description |
---|---|
thin | Defines a thin top border. |
medium | Default Value. Defines a medium top border. |
thick | Defines a thick top border. |
length | Allows you to customize the width of the top border. |
inherit | Specifies that the border width should be inherited from the parent element. |
Technical Details
Default Value: | medium |
---|---|
Inheritance: | no |
Version: | CSS1 |
JavaScript Syntax: | object.style.borderTopWidth="thick" |
More Examples
- Set the width of the top border
- This example demonstrates how to set the width of the top border.
Browser Support
The numbers in the table indicate the first browser version that fully supports this property.
Chrome | IE / Edge | Firefox | Safari | Opera |
---|---|---|---|---|
1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Note:Browsers with versions prior to IE7 do not support the value "inherit". IE8 requires !DOCTYPE. IE9 supports "inherit".
- previous page border-top-style
- Επόμενη Σελίδα border-width