我们的志愿者还没有将这篇文章翻译为 中文 (简体)。加入我们帮助完成翻译!
Summary
The border-top-width
CSS property sets the width of the top border of a box.
Initial value | medium |
---|---|
Applies to | all elements. It also applies to ::first-letter . |
Inherited | no |
Media | visual |
Computed value | the absolute length or 0 if border-top-style is none or hidden |
Animatable | yes, as a length |
Canonical order | the unique non-ambiguous order defined by the formal grammar |
Syntax
/* Any <length> value */ border-top-width: 10em; border-top-width: 3vmax; border-top-width: 6px; /* A keyword */ border-top-width: thin; border-top-width: medium; border-top-width: thick; border-top-width: inherit;
Values
<br-width>
- Is either a non-negative explicit
<length>
value or a keyword denoting the thickness of the bottom border. The keyword must be one of the following values:thin
A thin border medium
A medium border thick
A thick border thin ≤ medium ≤ thick
inequality and that the values are constant on a single document. inherit
- Represents the calculated value of the
border-top-width
of the parent's element.
Formal syntax
<br-width>
Examples
element { border-top-width: thin; border-top-style: solid; border-top-color: #000; }
.element1{ border-top: thick solid red; } .element2{ border-top: medium solid orange; } .element3{ border-top: thin solid green; }
Live Sample
Element 1
Element 2
Element 3
Specifications
Specification | Status | Comment |
---|---|---|
CSS Backgrounds and Borders Module Level 3 The definition of 'border-top-width' in that specification. |
Candidate Recommendation | No significant change |
CSS Level 2 (Revision 1) The definition of 'border-top-width' in that specification. |
Recommendation | Initial definition |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 1.0 | 1.0 (1.0) | 4.0 | 3.5 | 1.0 (85) |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | ? | ? | ? | ? | ? |
See also
- The other border-width-related CSS properties:
border-left-width
,border-right-width
,border-bottom-width
, andborder-width
- The other border-top-related CSS properties:
border
,border-top
,border-top-style
, andborder-top-color
.
文档标签和贡献者
标签:
此页面的贡献者:
Sebastianz,
Prinz_Rana,
fscholz,
jsx,
kscarfone,
teoli,
ninad_ingole,
SiddharthBhatt,
Sheppy,
ethertank,
Yuichiro,
Killerowski,
Mgjbot,
BijuGC
最后编辑者:
Sebastianz,