Properti peregangan font CSS
Contoh
Buat teks dalam elemen <div> lebih lebar:
div
{
font-family: sans-serif, "Helvetica Neue", "Lucida Grande", Arial;
font-stretch: expanded;
}
Definisi dan Penggunaan
Properti font-stretch
ini memungkinkan Anda untuk membuat teks lebih sempit (dipadatkan) atau lebih lebar (diperluas).
Catatan: Beberapa font menyediakan wajah tambahan; wajah kental dan wajah diperluas. Untuk font ini, Anda dapat menggunakan font-stretch
properti untuk memilih wajah font normal, kental, atau diperluas.
Catatan: Properti ini tidak berpengaruh jika font yang dipilih tidak menawarkan wajah yang dipadatkan atau diperluas!
Nilai bawaan: | normal |
---|---|
Diwarisi: | Ya |
Animasi: | Ya. Baca tentang animasi |
Versi: kapan: | CSS3 |
Sintaks JavaScript: | objek .style.fontStretch="diperluas" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
font-stretch | 48.0 | 9.0 | 9.0 | 11.0 | 35.0 |
Sintaksis
font-stretch: ultra-condensed|extra-condensed|condensed|semi-condensed|normal|semi-expanded|expanded|extra-expanded|ultra-expanded|initial|inherit;
Nilai properti
Value | Description |
---|---|
ultra-condensed | Makes the text as narrow as it gets |
extra-condensed | Makes the text narrower than condensed, but not as narrow as ultra-condensed |
condensed | Makes the text narrower than semi-condensed, but not as narrow as extra-condensed |
semi-condensed | Makes the text narrower than normal, but not as narrow as condensed |
normal | Default value. No font stretching |
semi-expanded | Makes the text wider than normal, but not as wide as expanded |
expanded | Makes the text wider than semi-expanded, but not as wide as extra-expanded |
extra-expanded | Makes the text wider than expanded, but not as wide as ultra-expanded |
ultra-expanded | Makes the text as wide as it gets |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |