'line-height' Example : line height « CSS Attributes and Javascript Style Properties « HTML CSS Reference






'line-height' Example

    
<html>
<body>
<p id="myP" 
   style="background-color:#EEEEEE">
This is the first line if a sample text.
<br>And this is its second line.
</p>

<input type="button" 
       value="Set lineHeight to 30px" 
       onclick="myP.style.lineHeight='30px'">
       
<input type="button" 
       value="Restore line height to normal" 
       onclick="myP.style.lineHeight='normal'">

<input type="button" 
       value="Restore line height to 50%" 
       onclick="myP.style.lineHeight='50%'">
</body>
</html>

    
      
      








Related examples in the same category

1.'line-height' Syntax and Note
2.'line-height' Possible Values
3.'line-height' is applied to