Propriété borderLeft de style
Exemple
Ajoutez une bordure gauche à un élément <div> :
document.getElementById("myDiv").style.borderLeft = "thick solid #0000FF";
Définition et utilisation
La propriété borderLeft définit ou renvoie jusqu'à trois propriétés border-left distinctes, sous une forme abrégée.
Avec cette propriété, vous pouvez définir/retourner un ou plusieurs des éléments suivants (dans n'importe quel ordre) :
- bordure-gauche-largeur
- style bordure gauche
- border-left-color
Prise en charge du navigateur
La propriété borderLeft est prise en charge dans tous les principaux navigateurs.
Syntaxe
Renvoyez la propriété borderLeft :
object.style.borderLeft
Définissez la propriété borderLeft :
object.style.borderLeft = "width style color|initial|inherit"
Valeurs de propriété
Parameter | Description |
---|---|
width | Sets the width of the left border |
style | Sets the style of the left border |
color | Sets the color of the left border |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Détails techniques
Valeur par défaut: | non spécifié |
---|---|
Valeur de retour : | Une chaîne, représentant la largeur, le style et/ou la couleur de la bordure gauche d'un élément |
Version CSS | CSS1 |
Plus d'exemples
Exemple
Modifiez la largeur, le style et la couleur de la bordure gauche d'un élément <div> :
document.getElementById("myDiv").style.borderLeft = "thin dotted red";
Exemple
Renvoie les valeurs de la propriété border-left d'un élément <div> :
alert(document.getElementById("myDiv").style.borderLeft);
Pages connexes
Tutoriel CSS : Bordure CSS
Référence CSS : propriété border-left
Référence HTML DOM : propriété border