Properti berat font CSS
Contoh
Atur bobot font yang berbeda untuk tiga paragraf:
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
Definisi dan Penggunaan
Properti font-weight
mengatur seberapa tebal atau tipis karakter dalam teks harus ditampilkan.
Nilai bawaan: | normal |
---|---|
Diwarisi: | Ya |
Animasi: | Ya. Baca tentang animasi |
Versi: kapan: | CSS1 |
Sintaks JavaScript: | objek .style.fontWeight="tebal" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
font-weight | 2.0 | 4.0 | 1.0 | 1.3 | 3.5 |
Sintaks CSS
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
Nilai properti
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 |
Halaman Terkait
Tutorial CSS: Font CSS
Referensi CSS: properti font
Referensi DOM HTML: properti fontWeight