propriété HTML DOM style borderLeft
Définition et utilisation
propriété raccourcie borderLeft pour définir ou retourner la frontière gauche de trois propriétés indépendantes.
Avec cette propriété, vous pouvez définir / retour:
- border-left-width
- border-left style
- border-left-color
grammaire
Définition des propriétés borderLeft:
Object.style.borderLeft="width style color"
Retour propriétés borderLeft:
Object.style.borderLeft
Astuce: borderLeft propriété n'a pas de valeur par défaut.
参数 | 描述 |
---|---|
width | 设置左边框的宽度。 |
style | 设置左边框的样式。 |
color | 设置左边框的颜色。 |
support du navigateur
Tous les principaux navigateurs prennent en charge la propriété borderLeft.
Exemples
Exemples
Changer la largeur gauche de la frontière, le style et la couleur:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Titre> Ce tutoriel (w3big.com) </ title>
<Style type = "text / css">
# Ex1 {
border: minces pointillées # FF0000;
}
</ Style>
<Script>
fonction displayResult () {
. Document.getElementById ( "ex1") style.borderLeft = "# 0000FF épaisse solide";
}
</ Script>
</ Head>
<Body>
<Div id = "ex1"> Ceci est un texte. </ Div>
<br>
<Bouton type = "button" onclick = "displayResult ()"> Modifier la bordure gauche </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Titre> Ce tutoriel (w3big.com) </ title>
<Style type = "text / css">
# Ex1 {
border: minces pointillées # FF0000;
}
</ Style>
<Script>
fonction displayResult () {
. Document.getElementById ( "ex1") style.borderLeft = "# 0000FF épaisse solide";
}
</ Script>
</ Head>
<Body>
<Div id = "ex1"> Ceci est un texte. </ Div>
<br>
<Bouton type = "button" onclick = "displayResult ()"> Modifier la bordure gauche </ button>
</ Body>
</ Html>
Essayez »
style Objets