HTML DOM lineHeight Property
Complete Style Object Reference
Definition and Usage
The lineHeight property sets the distance between lines (sets the
line-height).
Syntax
Object.style.lineHeight=normal|number|length|%
|
Possible Values
Value |
Description |
normal |
Sets a reasonable distance between lines |
number |
Sets a number that will be multiplied with the current
font-size to set the distance between the lines |
length |
Sets a fixed distance between the lines |
% |
Sets a distance between the lines in % of the current
font size |
Example
The following example changes the line-height:
<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>
|
Try-It-Yourself Demos
lineHeight - Change the line-height
Complete Style Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|