Proprietà confine CSS
Esempio
Imposta lo stile dei bordi per i diversi elementi:
h1 {
border: 5px solid red;
}
h2 {
border: 4px dotted blue;
}
div {
border:
double;
}
Definizione e utilizzo
La border
proprietà è una proprietà abbreviata per:
- larghezza del bordo
- stile bordo (richiesto)
- colore del bordo
Se il colore del bordo 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.border="3px blu fisso" |
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente la proprietà.
Property | |||||
---|---|---|---|---|---|
border | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Sintassi CSS
border: border-width border-style border-color|initial|inherit;
Valori di proprietà
Value | Description |
---|---|
border-width | Specifies the width of the border. Default value is "medium" |
border-style | Specifies the style of the border. Default value is "none" |
border-color | Specifies the color of the 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
Tutorial CSS: Modello CSS Box
Riferimento HTML DOM: proprietà border