Styl liniiWysokość Właściwość
Przykład
Ustaw wysokość linii dla elementu <div>:
document.getElementById("myDiv").style.lineHeight = "3";
Definicja i użycie
Właściwość lineHeight ustawia lub zwraca odległość między wierszami w tekście.
Obsługa przeglądarki
Property | |||||
---|---|---|---|---|---|
lineHeight | Yes | Yes | Yes | Yes | Yes |
Składnia
Zwróć właściwość lineHeight:
object.style.lineHeight
Ustaw właściwość lineHeight:
object.style.lineHeight = "normal|number|length|%|initial|inherit"
Wartości nieruchomości
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 |
Szczegóły techniczne
Domyślna wartość: | normalna |
---|---|
Wartość zwrotu: | String, reprezentujący odległość między wierszami w tekście |
Wersja CSS | CSS1 |
Więcej przykładów
Przykład
Zwróć wysokość linii elementu <div>:
alert(document.getElementById("myDiv").style.lineHeight);
Powiązane strony
Samouczek CSS: Tekst CSS
Odniesienie CSS: właściwość wysokości linii
❮ Obiekt stylu