CSS lettertipe-gewig eiendom
Voorbeeld
Stel verskillende lettergewig vir drie paragrawe:
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
Definisie en gebruik
Die font-weight
eienskap stel hoe dik of dun karakters in teks vertoon moet word.
Standaard waarde: | normaal |
---|---|
Geërf: | ja |
Animateerbaar: | ja. Lees oor animeerbaar |
Weergawe: | CSS1 |
JavaScript-sintaksis: | voorwerp .style.fontWeight="bold" |
Blaaierondersteuning
Die nommers in die tabel spesifiseer die eerste blaaierweergawe wat die eiendom ten volle ondersteun.
Property | |||||
---|---|---|---|---|---|
font-weight | 2.0 | 4.0 | 1.0 | 1.3 | 3.5 |
CSS-sintaksis
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
Eiendomswaardes
Value | Description | Play it |
---|---|---|
normal | Defines normal characters. This is default | |
bold | Defines thick characters | |
bolder | Defines thicker characters | |
lighter | Defines lighter characters | |
100 200 300 400 500 600 700 800 900 |
Defines from thin to thick characters. 400 is the same as normal, and 700 is the same as bold | |
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-tutoriaal: CSS Font
CSS verwysing: font eiendom
HTML DOM verwysing: fontWeight eiendom