Stil lineHeight Özellik
Örnek
Bir <div> öğesi için satır yüksekliğini ayarlayın:
document.getElementById("myDiv").style.lineHeight = "3";
Tanım ve Kullanım
lineHeight özelliği, bir metindeki satırlar arasındaki mesafeyi ayarlar veya döndürür.
Tarayıcı Desteği
Property | |||||
---|---|---|---|---|---|
lineHeight | Yes | Yes | Yes | Yes | Yes |
Sözdizimi
lineHeight özelliğini döndürün:
object.style.lineHeight
lineHeight özelliğini ayarlayın:
object.style.lineHeight = "normal|number|length|%|initial|inherit"
Mülk değerleri
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 |
Teknik detaylar
Varsayılan değer: | normal |
---|---|
Geri dönüş değeri: | Metindeki satırlar arasındaki mesafeyi temsil eden bir Dize |
CSS Sürümü | CSS1 |
Daha fazla örnek
Örnek
Bir <div> öğesinin satır yüksekliğini döndürün:
alert(document.getElementById("myDiv").style.lineHeight);
İlgili Sayfalar
CSS eğitimi: CSS Metni
CSS referansı: satır yüksekliği özelliği
❮ Stil Nesnesi