propriété HTML DOM style lineHeight
Définition et utilisation
lineHeight ensembles de propriétés ou renvoie la distance entre les lignes de texte.
grammaire
Définition des propriétés de lineHeight:
Object.style.lineHeight="normal|number|length|%|inherit"
Retour propriétés lineHeight:
Object.style.lineHeight
值 | 描述 |
---|---|
normal | 默认。设置合理的行间距。 |
number | 设置数字,此数字会与当前的字体尺寸相乘来设置行间距。 |
length | 使用 px、cm 等单位定义行间距。 |
% | 定义行间距为当前字体尺寸的百分比。 |
inherit | lineHeight 属性的值从父元素继承。 |
support du navigateur
Tous les principaux navigateurs prennent en charge la propriété lineHeight.
Note: IE7 et les versions antérieures ne supportent pas la valeur "inherit".IE8 ne fournit DOCTYPE! Supporté "inherit". soutien IE9 "inherit".
Exemples
Exemples
Modifier la hauteur de ligne:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Titre> Ce tutoriel (w3big.com) </ title>
<Script>
fonction displayResult () {
. Document.getElementById ( "div1") style.lineHeight = "2";
}
</ Script>
</ Head>
<Body>
<Div id = "div1">
Ceci est un texte. Ceci est un texte. Ceci est un texte. Ceci est un texte.
Ceci est un texte. Ceci est un texte. Ceci est un texte. Ceci est un texte.
Ceci est un texte. Ceci est un texte. Ceci est un texte. Ceci est un texte.
Ceci est un texte. Ceci est un texte. Ceci est un texte. Ceci est un texte.
</ Div>
<br>
<Type Bouton = "button" onclick = "displayResult ()"> Modifier la hauteur de ligne </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Titre> Ce tutoriel (w3big.com) </ title>
<Script>
fonction displayResult () {
. Document.getElementById ( "div1") style.lineHeight = "2";
}
</ Script>
</ Head>
<Body>
<Div id = "div1">
Ceci est un texte. Ceci est un texte. Ceci est un texte. Ceci est un texte.
Ceci est un texte. Ceci est un texte. Ceci est un texte. Ceci est un texte.
Ceci est un texte. Ceci est un texte. Ceci est un texte. Ceci est un texte.
Ceci est un texte. Ceci est un texte. Ceci est un texte. Ceci est un texte.
</ Div>
<br>
<Type Bouton = "button" onclick = "displayResult ()"> Modifier la hauteur de ligne </ button>
</ Body>
</ Html>
Essayez »
style Objets