Stile borderLeft Proprietà
Esempio
Aggiungi un bordo sinistro a un elemento <div>:
document.getElementById("myDiv").style.borderLeft = "thick solid #0000FF";
Definizione e utilizzo
La proprietà borderLeft imposta o restituisce fino a tre proprietà border-left separate, in forma abbreviata.
Con questa proprietà, puoi impostare/restituire uno o più dei seguenti (in qualsiasi ordine):
- bordo-sinistra-larghezza
- stile bordo sinistro
- bordo-sinistra-colore
Supporto browser
La proprietà borderLeft è supportata in tutti i principali browser.
Sintassi
Restituisci la proprietà borderLeft:
object.style.borderLeft
Imposta la proprietà borderLeft:
object.style.borderLeft = "width style color|initial|inherit"
Valori di proprietà
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 |
Dettagli tecnici
Valore di default: | non specificato |
---|---|
Valore di ritorno: | Una stringa, che rappresenta la larghezza, lo stile e/o il colore del bordo sinistro di un elemento |
Versione CSS | CSS1 |
Altri esempi
Esempio
Modifica la larghezza, lo stile e il colore del bordo sinistro di un elemento <div>:
document.getElementById("myDiv").style.borderLeft = "thin dotted red";
Esempio
Restituisce i valori della proprietà del bordo sinistro di un elemento <div>:
alert(document.getElementById("myDiv").style.borderLeft);
Pagine correlate
Tutorial CSS: Bordo CSS
Riferimento CSS: proprietà border-left
Riferimento HTML DOM: proprietà border