Properti Font CSS
Properti Font CSS
Untuk mempersingkat kode, dimungkinkan juga untuk menentukan semua properti font individual dalam satu properti.
Properti font
adalah properti singkatan untuk:
font-style
font-variant
font-weight
font-size/line-height
font-family
Catatan: Nilai font-size
and font-family
wajib diisi. Jika salah satu nilai lainnya tidak ada, nilai defaultnya akan digunakan.
Contoh
Gunakan font
untuk mengatur beberapa properti font dalam satu deklarasi:
p.a
{
font: 20px Arial, sans-serif;
}
p.b
{
font: italic small-caps bold 12px/30px Georgia, serif;
}
Semua Properti Font CSS
Property | Description |
---|---|
font | Sets all the font properties in one declaration |
font-family | Specifies the font family for text |
font-size | Specifies the font size of text |
font-style | Specifies the font style for text |
font-variant | Specifies whether or not a text should be displayed in a small-caps font |
font-weight | Specifies the weight of a font |