Gaya fontSizeAdjust Property
Contoh
Sesuaikan ukuran font:
document.getElementById("demo").style.fontSizeAdjust = "0.58";
Definisi dan Penggunaan
Properti fontSizeAdjust menyetel atau mengembalikan nilai aspek font dari teks.
Semua font memiliki nilai aspek yang merupakan perbedaan ukuran antara huruf kecil "x" dan huruf besar "X".
Properti fontSizeAdjust memberi Anda kontrol ukuran font yang lebih baik saat font pilihan pertama tidak tersedia. Saat font tidak tersedia, browser menggunakan font kedua yang ditentukan. Ini bisa mengakibatkan perubahan besar untuk ukuran font. Untuk mencegahnya, gunakan properti ini.
Ketika browser mengetahui nilai aspek untuk font pilihan pertama, browser dapat mengetahui ukuran font apa yang digunakan saat menampilkan teks dengan font pilihan kedua.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
fontSizeAdjust | Not supported | Not supported | Yes | Not supported | Not supported |
Sintaksis
Kembalikan properti fontSizeAdjust:
object.style.fontSizeAdjust
Setel properti fontSizeAdjust:
object.style.fontSizeAdjust = "none|number|initial|inherit"
Value | Description |
---|---|
none | Default value. No font size adjustment |
number | Preserve the first-choice font's x-height, and calculate the aspect value ratio for the font. The formula that is used: font-size of first-choice font*(aspect value of first-choice font/aspect value of available font)=font-size to use on available font Example: If 14px Verdana (aspect value of 0.58) was unavailable, but the available font, Times New Roman, has an aspect value of 0.46, the adjusted font-size to use would be 14*(0.58/0.46) = 17.65px. |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Detail Teknis
Nilai Bawaan: | tidak ada |
---|---|
Nilai Kembali: | Sebuah String, mewakili nilai aspek font dari sebuah teks |
Versi CSS | CSS3 |
Halaman Terkait
Tutorial CSS: Font CSS
Referensi CSS: properti ukuran font
Referensi DOM HTML: properti font
Objek Gaya