Stile borderTopStyle Proprietà
Esempio
Aggiungi un bordo superiore "solido" a un elemento <div>:
document.getElementById("myDiv").style.borderTopStyle = "solid";
Definizione e utilizzo
La proprietà borderTopStyle imposta o restituisce lo stile del bordo superiore di un elemento.
Supporto browser
Property | |||||
---|---|---|---|---|---|
borderTopStyle | Yes | Yes | Yes | Yes | Yes |
Sintassi
Restituisce la proprietà borderTopStyle:
object.style.borderTopStyle
Imposta la proprietà borderTopStyle:
object.style.borderTopStyle = value
|initial|inherit
Valori di proprietà
Value | Description |
---|---|
none | Defines no border. This is default |
hidden | Same as "none", except in border conflict resolution for table elements |
dotted | Defines a dotted border |
dashed | Defines a dashed border |
solid | Defines a solid border |
double | Defines two borders. The width of the two borders are the same as the border-width value |
groove | Defines a 3D grooved border. The effect depends on the border-color value |
ridge | Defines a 3D ridged border. The effect depends on the border-color value |
inset | Defines a 3D inset border. The effect depends on the border-color value |
outset | Defines a 3D outset border. The effect depends on the border-color value |
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: | nessuno |
---|---|
Valore di ritorno: | Una stringa, che rappresenta lo stile del bordo superiore di un elemento |
Versione CSS | CSS1 |
Altri esempi
Esempio
Cambia lo stile del bordo superiore di un elemento <div> in "punteggiato":
document.getElementById("myDiv").style.borderTopStyle = "dotted";
Esempio
Restituisce lo stile del bordo superiore di un elemento <div>:
alert(document.getElementById("myDiv").style.borderTopStyle);
Esempio
Una dimostrazione di tutti i diversi valori:
var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("myDiv").style.borderTopStyle = listValue;
Pagine correlate
Tutorial CSS: Bordo CSS
Riferimento CSS: proprietà border-top-style
Riferimento HTML DOM: proprietà border
❮ Oggetto stile