Properti tinggi garis gaya
Contoh
Atur tinggi garis untuk elemen <div>:
document.getElementById("myDiv").style.lineHeight = "3";
Definisi dan Penggunaan
Properti lineHeight mengatur atau mengembalikan jarak antar baris dalam teks.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
lineHeight | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti lineHeight:
object.style.lineHeight
Setel properti lineHeight:
object.style.lineHeight = "normal|number|length|%|initial|inherit"
Nilai properti
Value | Description |
---|---|
normal | Normal line height is used. This is default |
number | A number that will be multiplied with the current font size to set the line height |
length | Defines the line height in length units |
% | Defines the line height in % of the current font size |
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: | normal |
---|---|
Nilai Kembali: | Sebuah String, mewakili jarak antar baris dalam teks |
Versi CSS | CSS1 |
Lebih Banyak Contoh
Contoh
Kembalikan tinggi garis elemen <div>:
alert(document.getElementById("myDiv").style.lineHeight);
Halaman Terkait
Tutorial CSS: Teks CSS
Referensi CSS: properti line-height
Objek Gaya