Vlastnost CSS font-weight
Příklad
Nastavte různou váhu písma pro tři odstavce:
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
Definice a použití
Tato font-weight
vlastnost nastavuje, jak silné nebo tenké znaky v textu se mají zobrazovat.
Výchozí hodnota: | normální |
---|---|
Zděděno: | Ano |
Animovatelné: | Ano. Přečtěte si o tématu Animable |
Verze: | CSS1 |
Syntaxe JavaScriptu: | objekt .style.fontWeight="bold" |
Podpora prohlížeče
Čísla v tabulce určují první verzi prohlížeče, která plně podporuje vlastnost.
Property | |||||
---|---|---|---|---|---|
font-weight | 2.0 | 4.0 | 1.0 | 1.3 | 3.5 |
Syntaxe CSS
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
Hodnoty vlastností
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 |
Související stránky
CSS tutoriál: CSS Font
CSS reference: vlastnost fontu
Odkaz HTML DOM: vlastnost fontWeight