Propriété de bordure CSS
Exemple
Définissez le style des bordures pour différents éléments :
h1 {
border: 5px solid red;
}
h2 {
border: 4px dotted blue;
}
div {
border:
double;
}
Définition et utilisation
La border
propriété est une propriété abrégée pour :
- largeur de la bordure
- style bordure (obligatoire)
- couleur de la bordure
Si border-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.border="3px bleu uni" |
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 | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Syntaxe CSS
border: border-width border-style border-color|initial|inherit;
Valeurs de propriété
Value | Description |
---|---|
border-width | Specifies the width of the border. Default value is "medium" |
border-style | Specifies the style of the border. Default value is "none" |
border-color | Specifies the color of the 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
Tutoriel CSS : Modèle de boîte CSS
Référence HTML DOM : propriété border