Styl lineHeight Eiendom
Voorbeeld
Stel die lynhoogte vir 'n <div>-element:
document.getElementById("myDiv").style.lineHeight = "3";
Definisie en gebruik
Die lineHeight-eienskap stel of gee die afstand tussen lyne in 'n teks terug.
Blaaierondersteuning
Property | |||||
---|---|---|---|---|---|
lineHeight | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Gee die lineHeight-eienskap terug:
object.style.lineHeight
Stel die lineHeight-eienskap:
object.style.lineHeight = "normal|number|length|%|initial|inherit"
Eiendomswaardes
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 |
Tegniese besonderhede
Standaard waarde: | normaal |
---|---|
Terugkeerwaarde: | 'n String wat die afstand tussen lyne in die teks voorstel |
CSS weergawe | CSS1 |
Meer voorbeelde
Voorbeeld
Gee die lynhoogte van 'n <div>-element terug:
alert(document.getElementById("myDiv").style.lineHeight);
Verwante bladsye
CSS-tutoriaal: CSS-teks
CSS verwysing: lynhoogte eiendom
❮ Stylvoorwerp