Properti bergaya font CSS
Contoh
Atur gaya font yang berbeda untuk tiga paragraf:
p.a {
font-style: normal;
}
p.b {
font-style: italic;
}
p.c {
font-style: oblique;
}
Definisi dan Penggunaan
Properti font-style
menentukan gaya font untuk teks.
Nilai bawaan: | normal |
---|---|
Diwarisi: | Ya |
Animasi: | tidak. Baca tentang animasi |
Versi: kapan: | CSS1 |
Sintaks JavaScript: | objek .style.fontStyle="italic" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
font-style | 1.0 | 4.0 | 1.0 | 1.0 | 7.0 |
Sintaks CSS
font-style: normal|italic|oblique|initial|inherit;
Nilai properti
Value | Description | Play it |
---|---|---|
normal | The browser displays a normal font style. This is default | |
italic | The browser displays an italic font style | |
oblique | The browser displays an oblique font style | |
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 fontStyle