Propriété CSS font-weight
Exemple
Définissez un poids de police différent pour trois paragraphes :
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
Définition et utilisation
La font-weight
propriété définit la manière dont les caractères épais ou fins dans le texte doivent être affichés.
Valeur par défaut: | Ordinaire |
---|---|
Hérité: | Oui |
Animable : | Oui. En savoir plus sur l'animation |
Version: | CSS1 |
Syntaxe JavaScript : | objet .style.fontWeight="gras" |
Prise en charge du navigateur
Les nombres dans le tableau indiquent la première version du navigateur qui prend entièrement en charge la propriété.
Property | |||||
---|---|---|---|---|---|
font-weight | 2.0 | 4.0 | 1.0 | 1.3 | 3.5 |
Syntaxe CSS
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
Valeurs de propriété
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 |
Pages connexes
Tutoriel CSS : Police CSS
Référence CSS : propriété de la police
Référence HTML DOM : propriété fontWeight