Propriété CSS border-top
Exemple
Définissez le style de la bordure supérieure pour différents éléments :
h1 {
border-top: 5px solid red;
}
h2 {
border-top: 4px dotted blue;
}
div {
border-top: double;
}
Définition et utilisation
La border-top
propriété raccourcie définit toutes les propriétés de bordure supérieure dans une seule déclaration.
Les propriétés pouvant être définies doivent être dans l'ordre suivant :
- border-top-width
- border-top-style (obligatoire)
- border-top-color
Si border-top-color est omis, la couleur appliquée sera la couleur du texte.
Valeur par défaut: | moyen aucune couleur |
---|---|
Hérité: | non |
Animable : | oui, voir propriétés individuelles . En savoir plus sur l'animation |
Version: | CSS1 |
Syntaxe JavaScript : | objet .style.borderTop="3px bleu pointillé" |
Prise en charge du navigateur
Les nombres dans le tableau indiquent la première version du navigateur qui prend entièrement en charge la propriété.
Property | |||||
---|---|---|---|---|---|
border-top | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Syntaxe CSS
border-top: border-width border-style border-color|initial|inherit;
Valeurs de propriété
Value | Description |
---|---|
border-top-width | Required. Specifies the width of the top border. Default value is "medium" |
border-top-style | Required. Specifies the style of the top border. Default value is "none" |
border-top-color | Optional. Specifies the color of the top border. Default value is the color of the text |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Pages connexes
Tutoriel CSS : Bordure CSS
Référence HTML DOM : propriété borderTop