CSS grens Eiendom
Voorbeeld
Stel die styl van die grense vir verskillende elemente:
h1 {
border: 5px solid red;
}
h2 {
border: 4px dotted blue;
}
div {
border:
double;
}
Definisie en gebruik
Die border
eiendom is 'n snelskrif eiendom vir:
- grens-breedte
- grensstyl (vereis)
- rand-kleur
As grenskleur weggelaat word, sal die kleur wat toegepas word die kleur van die teks wees.
Standaard waarde: | medium geen kleur nie |
---|---|
Geërf: | geen |
Animateerbaar: | ja, sien individuele eiendomme . Lees oor animeerbaar |
Weergawe: | CSS1 |
JavaScript-sintaksis: | voorwerp .style.border="3px soliede blou" |
Blaaierondersteuning
Die nommers in die tabel spesifiseer die eerste blaaierweergawe wat die eiendom ten volle ondersteun.
Property | |||||
---|---|---|---|---|---|
border | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
CSS-sintaksis
border: border-width border-style border-color|initial|inherit;
Eiendomswaardes
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 |
Verwante bladsye
CSS handleiding: CSS Border
CSS handleiding: CSS Box Model
HTML DOM verwysing: grens eiendom