Podsumowanie
Własność border-top jest skróconą własnością dla ustawienia szerokości, stylu i koloru górnej krawędzi elementu. Ta własność może być używana do ustawienia jednej lub kilku wartości: border-top-width, border-top-style, border-top-color. Pominięte wartości są ustawiane do ich wartości początkowych.
| Wartość początkowa | as each of the properties of the shorthand:
|
|---|---|
| Stosowana do | wszystkich elementów. It also applies to ::first-letter. |
| Dziedziczona | no |
| Media | visual |
| Wartość wyliczona | as each of the properties of the shorthand:
|
| Animatable | as each of the properties of the shorthand:
|
| Canonical order | order of appearance in the formal grammar of the values |
Składnia
border-top: [border-width || border-style || border-color | inherit] ;
Wartości
- border-width
- Zobacz
border-width. - border-style
- Zobacz
border-style. - border-color
- Zobacz
border-color.
Przykłady
element {
border-top: 1px solid #000;
}
Notatki
Jeśli reguła nie określi koloru krawędzi, krawędź będzie miała kolor zdefiniowany przez własność color.
Specifications
| Specification | Status | Comment |
|---|---|---|
| CSS Backgrounds and Borders Module Level 3 The definition of 'border-top' in that specification. |
Candidate Recommendation | No direct changes, though the modification of values for the border-top-color do apply to it. |
| CSS Level 2 (Revision 1) The definition of 'border-top' in that specification. |
Recommendation | No significant changes |
| CSS Level 1 The definition of 'border-top' in that specification. |
Recommendation | Initial definition |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
|---|---|---|---|---|---|
| Basic support | 1.0 | 1.0 (1.7 or earlier) | 4 | 3.5 | 1.0 (85) |
| Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | 1.0 | 1.0 (1.0) | (Yes) | (Yes) | (Yes) |