Stile borderTopColor Proprietà
Esempio
Cambia il colore del bordo superiore di un elemento <div> in rosso:
document.getElementById("myDiv").style.borderTopColor = "red";
Definizione e utilizzo
La proprietà borderTopColor imposta o restituisce il colore del bordo superiore di un elemento.
Supporto browser
Property | |||||
---|---|---|---|---|---|
borderTopColor | Yes | Yes | Yes | Yes | Yes |
Sintassi
Restituisce la proprietà borderTopColor:
object.style.borderTopColor
Imposta la proprietà borderTopColor:
object.style.borderTopColor = "color|transparent|initial|inherit"
Valori di proprietà
Value | Description |
---|---|
color | Specifies the color of the top border. Look at CSS Color Values for a complete list of possible color values. Default color is the current color of the element |
transparent | The color of the top border is transparent (underlying content will shine through) |
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: | colore attuale |
---|---|
Valore di ritorno: | Una stringa, che rappresenta il colore del bordo superiore di un elemento |
Versione CSS | CSS1 |
Altri esempi
Esempio
Restituisce il colore del bordo superiore di un elemento <div>:
alert(document.getElementById("myDiv").style.borderTopColor);
Pagine correlate
Tutorial CSS: Bordo CSS
Riferimento CSS: proprietà border-top-color
Riferimento HTML DOM: proprietà border
❮ Oggetto stile