HTML DOM lineHeight ÊôÐÔ
¶¨ÒåºÍÓ÷¨
lineHeight ÊôÐÔÉèÖÃÐÐÖ®¼äµÄ¾àÀ루Ðиߣ©¡£
Óï·¨£º
Object.style.lineHeight=normal|number|length|%
¿ÉÄܵÄÖµ
Öµ | ÃèÊö |
---|---|
normal | ĬÈÏ¡£ÉèÖúÏÀíµÄÐмä¾à¡£ |
number | ÉèÖÃÊý×Ö£¬´ËÊý×Ö»áÓ뵱ǰµÄ×ÖÌå³ß´çÏà³ËÀ´ÉèÖÃÐмä¾à¡£ |
length | ÉèÖù̶¨µÄÐмä¾à¡£ |
% | »ùÓÚµ±Ç°×ÖÌå³ß´çµÄ°Ù·Ö±ÈÐмä¾à¡£ |
ʵÀý
±¾Àý¸Ä±äÐиߣº
<html>
<head>
<script type="text/javascript">
function changeLineHeight()
{
document.getElementById("div1").style.lineHeight="2";
}
</script>
</head>
<body>
<div id="div1">
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
</div>
<br />
<input type="button" onclick="changeLineHeight()"
value="Change line-height" />
</body>
</html>