border-top-width
Summary
Sets the width of an element's top border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width.
Overview table
- Initial value
medium
- Applies to
- All elements
- Inherited
- No
- Media
- visual
- Computed value
- An absolute length; 0 if the border style is 'none' or 'hidden'
- Animatable
- No
- CSS Object Model Property
borderTopWidth
- Percentages
- N/A
Syntax
-
border-top-width: <width>
-
border-top-width: medium
-
border-top-width: thick
-
border-top-width: thin
Values
- medium
- Default.
- thin
- Less than the default width.
- thick
- Greater than the default width.
- <width>
- Floating-point number, followed by an absolute units designator (
cm
,mm
,in
,pt
, orpc
) or a relative units designator (em
,ex
, orpx
). For more information about the supported length units, see CSS Values and Units Reference.
Examples
CSS border width values.
.medium { border-top-width: medium; }.thin {
border-top-width: thin;
}.thick {
border-top-width: thick;
}.width {
border-top-width: 10px;
}
Related specifications
- W3C CSS Backgrounds and Borders Module Level 3
- Candidate Recommendation
See also
Related articles
Border
- border-top-width
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]