Proprietà bordo superiore CSS
Esempio
Imposta lo stile del bordo superiore per diversi elementi:
h1 {
border-top: 5px solid red;
}
h2 {
border-top: 4px dotted blue;
}
div {
border-top: double;
}
Definizione e utilizzo
La border-top
proprietà shorthand imposta tutte le proprietà del bordo superiore in un'unica dichiarazione.
Le proprietà che possono essere impostate devono essere nel seguente ordine:
Se il colore bordo superiore viene omesso, il colore applicato sarà il colore del testo.
Valore di default: | medio nessuno colore |
---|---|
Ereditato: | no |
Animabile: | sì, vedere le singole proprietà . Leggi su animabile |
Versione: | CSS1 |
sintassi JavaScript: | oggetto .style.borderTop="3px tratteggiato blu" |
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente la proprietà.
Property | |||||
---|---|---|---|---|---|
border-top | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Sintassi CSS
border-top: border-width border-style border-color|initial|inherit;
Valori di proprietà
Value | Description |
---|---|
border-top-width | Required. Specifies the width of the top border. Default value is "medium" |
border-top-style | Required. Specifies the style of the top border. Default value is "none" |
border-top-color | Optional. Specifies the color of the top border. Default value is the color of the text |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Pagine correlate
Tutorial CSS: Bordo CSS
Riferimento DOM HTML: proprietà borderTop