Proprietà CSS border-spacing
Esempio
Imposta la spaziatura del bordo per una tabella:
#table1 {
border-collapse: separate;
border-spacing: 15px;
}
#table2 {
border-collapse: separate;
border-spacing: 15px 50px;
}
Definizione e utilizzo
La border-spacing
proprietà imposta la distanza tra i bordi delle celle adiacenti.
Nota: questa proprietà funziona solo quando border-collapse è separato.
Valore di default: | 2px |
---|---|
Ereditato: | sì |
Animabile: | sì. Leggi su animabile |
Versione: | CSS2 |
sintassi JavaScript: | oggetto .style.borderSpacing="15px" |
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente la proprietà.
Property | |||||
---|---|---|---|---|---|
border-spacing | 1.0 | 8.0 | 1.0 | 1.0 | 4.0 |
Sintassi CSS
border-spacing: length|initial|inherit;
Valori di proprietà
Value | Description | Play it |
---|---|---|
length length | Specifies the distance between the borders of adjacent cells in px, cm, etc. Negative values are not allowed.
|
|
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: Tabella CSS
Riferimento HTML DOM: proprietà borderSpacing