CSS font-weight Property
Przykład
Ustaw inną grubość czcionki dla trzech akapitów:
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
Definicja i użycie
Właściwość font-weight
określa, jak grube lub cienkie znaki w tekście powinny być wyświetlane.
Domyślna wartość: | normalna |
---|---|
Dziedziczny: | tak |
Animowalny: | tak. Przeczytaj o animacji |
Wersja: | CSS1 |
Składnia JavaScript: | obiekt .style.fontWeight="pogrubienie" |
Obsługa przeglądarki
Liczby w tabeli określają pierwszą wersję przeglądarki, która w pełni obsługuje tę właściwość.
Property | |||||
---|---|---|---|---|---|
font-weight | 2.0 | 4.0 | 1.0 | 1.3 | 3.5 |
Składnia CSS
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
Wartości nieruchomości
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 |
Powiązane strony
Samouczek CSS: Czcionka CSS
Odniesienie CSS: właściwość czcionki
Odniesienie HTML DOM: właściwość fontWeight