Vlastnost stylu lineHeight
Příklad
Nastavte výšku řádku pro prvek <div>:
document.getElementById("myDiv").style.lineHeight = "3";
Definice a použití
Vlastnost lineHeight nastavuje nebo vrací vzdálenost mezi řádky v textu.
Podpora prohlížeče
Property | |||||
---|---|---|---|---|---|
lineHeight | Yes | Yes | Yes | Yes | Yes |
Syntax
Vraťte vlastnost lineHeight:
object.style.lineHeight
Nastavte vlastnost lineHeight:
object.style.lineHeight = "normal|number|length|%|initial|inherit"
Hodnoty vlastností
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 |
Technické údaje
Výchozí hodnota: | normální |
---|---|
Návratová hodnota: | Řetězec představující vzdálenost mezi řádky v textu |
Verze CSS | CSS1 |
Další příklady
Příklad
Vrátí výšku řádku prvku <div>:
alert(document.getElementById("myDiv").style.lineHeight);
Související stránky
CSS tutoriál: CSS Text
CSS reference: vlastnost line-height
❮ Objekt stylu