Properti style.lineHeight digunakan untuk menetapkan tinggi antar baris teks di dalam elemen block-level html, contohnya menetapkan tinggi antar baris teks di dalam suatu alinea.
Sintaks:
obj.style.lineHeight: value;
normal
(default).- Length
inherit
Contoh:
<HTML>
<HEAD>
<TITLE>style.lineHeight</TITLE>
<SCRIPT TYPE="text/javascript">
function changelineHeight()
{
document.getElementById("myp").style.lineHeight = "50px";
}
</SCRIPT>
</HEAD>
<BODY>
<P ID="myp">Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum... Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...Lorem ipsum...</P>
<BUTTON TYPE="button" ONCLICK="changelineHeight()">Change line height!</BUTTON>
</BODY>
</HTML>