Wednesday, October 13, 2010

CSS Line Spacing

line-height property is used to specify the amount of vertical space between lines of text. line-height indicated in the units, percentage or a multiplier.

following example shows how to set line-height.
1.<div style="background-color:#0099FF; line-height: 1cm;">
Line height - This is line 1 <br>
Line height - This is line 2 <br>
</div>

This result in:
Line height - This is line 1

Line height - This is line 2


2.
<div style="background-color:#0099FF; line-height: 30px;">
Line height - This is line 1 <br>
Line height - This is line 2 <br>
</div>

This results in:
Line height - This is line 1

Line height - This is line 2

No comments:

Post a Comment