Propriedade de peso de fonte CSS
Exemplo
Defina um peso de fonte diferente para três parágrafos:
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
Definição e uso
A font-weight
propriedade define como os caracteres grossos ou finos no texto devem ser exibidos.
Valor padrão: | normal |
---|---|
Herdado: | sim |
Animavel: | sim. Leia sobre animáveis |
Versão: | CSS1 |
Sintaxe JavaScript: | objeto .style.fontWeight="bold" |
Suporte ao navegador
Os números na tabela especificam a primeira versão do navegador que oferece suporte total à propriedade.
Property | |||||
---|---|---|---|---|---|
font-weight | 2.0 | 4.0 | 1.0 | 1.3 | 3.5 |
Sintaxe CSS
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
Valores de propriedade
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 |
Páginas relacionadas
Tutorial CSS: Fonte CSS
Referência CSS: propriedade da fonte
Referência HTML DOM: propriedade fontWeight