Proprietà CSS font-weight
Esempio
Imposta uno spessore del carattere diverso per tre paragrafi:
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
Definizione e utilizzo
La font-weight
proprietà imposta la modalità di visualizzazione dei caratteri spessi o sottili nel testo.
Valore di default: | normale |
---|---|
Ereditato: | sì |
Animabile: | sì. Leggi su animabile |
Versione: | CSS1 |
sintassi JavaScript: | oggetto .style.fontWeight="grassetto" |
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente la proprietà.
Property | |||||
---|---|---|---|---|---|
font-weight | 2.0 | 4.0 | 1.0 | 1.3 | 3.5 |
Sintassi CSS
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
Valori di proprietà
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 |
Pagine correlate
Tutorial CSS: Font CSS
Riferimento CSS: proprietà del carattere
Riferimento HTML DOM: proprietà fontWeight