CSS grens-bo-kleur Eiendom
Voorbeeld
Stel 'n kleur vir die boonste rand:
div {border-top-color: coral;}
Meer "Probeer dit self" voorbeelde hieronder.
Definisie en gebruik
Die border-top-color
eienskap stel die kleur van 'n element se boonste rand.
Let wel: Verklaar altyd die grens-styl of die
grens-top-styl eiendom voor die border-top-color
eiendom. 'n Element moet 'n rand hê voordat jy die kleur kan verander.
Standaard waarde: | Die huidige kleur van die element |
---|---|
Geërf: | geen |
Animateerbaar: | ja. Lees oor animeerbaar |
Weergawe: | CSS1 |
JavaScript-sintaksis: | voorwerp .style.borderTopColor="blou" |
Blaaierondersteuning
Die nommers in die tabel spesifiseer die eerste blaaierweergawe wat die eiendom ten volle ondersteun.
Property | |||||
---|---|---|---|---|---|
border-top-color | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
CSS-sintaksis
border-top-color: color|transparent|initial|inherit;
Eiendomswaardes
Value | Description | Play it |
---|---|---|
color | Specifies the color of the top border. Look at CSS Color Values for a complete list of possible color values. Default color is the current color of the element | |
transparent | Specifies that the border color should be transparent | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Meer voorbeelde
Voorbeeld
Stel 'n kleur vir die boonste rand met 'n HEX-waarde:
div {border-top-color: #92a8d1;}
Voorbeeld
Stel 'n kleur vir die boonste rand met 'n RGB-waarde:
div {border-top-color: rgb(201, 76, 76);}
Voorbeeld
Stel 'n kleur vir die boonste rand met 'n RGBA-waarde:
div {border-top-color: rgba(201, 76, 76, 0.3);}
Voorbeeld
Stel 'n kleur vir die boonste rand met 'n HSL-waarde:
div {border-top-color: hsl(89, 43%, 51%);}
Voorbeeld
Stel 'n kleur vir die boonste rand met 'n HSLA-waarde:
div {border-top-color: hsla(89, 43%, 51%, 0.3);}
Voorbeeld
Stel 'n deursigtige boonste rand:
div {border-top-color: transparent;}
Verwante bladsye
CSS handleiding: CSS Border
CSS verwysing: grens-top eiendom
HTML DOM verwysing: borderTopColor eiendom