Propriedade de estilo lineHeight
Exemplo
Defina a altura da linha para um elemento <div>:
document.getElementById("myDiv").style.lineHeight = "3";
Definição e uso
A propriedade lineHeight define ou retorna a distância entre as linhas em um texto.
Suporte ao navegador
Property | |||||
---|---|---|---|---|---|
lineHeight | Yes | Yes | Yes | Yes | Yes |
Sintaxe
Retorne a propriedade lineHeight:
object.style.lineHeight
Defina a propriedade lineHeight:
object.style.lineHeight = "normal|number|length|%|initial|inherit"
Valores de propriedade
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 |
Detalhes técnicos
Valor padrão: | normal |
---|---|
Valor de retorno: | Uma String, representando a distância entre as linhas no texto |
Versão CSS | CSS1 |
Mais exemplos
Exemplo
Retorne a altura da linha de um elemento <div>:
alert(document.getElementById("myDiv").style.lineHeight);
Páginas relacionadas
Tutorial CSS: Texto CSS
Referência CSS: propriedade line-height
❮ Objeto de estilo