AdBlock Detected!
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.
CSS Line-Height Property |
The line-height property specifies the amount of space between the baselines of two lines. A baseline is the bottom of most letters. The figure below illustrates what line-height represents:
Note that line-height is not the amount of space between two lines. Possible values for line-height include the following:
We show several examples below. Example 1: Using a number for line-height CSS Declaration
The following HTML code,
renders This paragraph illustrates setting the amount of space between two lines using a number. In Example 1, we set line-height to 2, which is equivalent to using double space between lines. Example 2: Using a percentage for line-height CSS Declaration
The following HTML code,
renders This paragraph illustrates setting the amount of space between two lines using a percentage. In Example 2, we set line-height to 80%, and that causes the lines to appear to be squeezed together. Example 3: Using a length for line-height CSS Declaration
The following HTML code,
renders This paragraph illustrates setting the amount of space between two lines using a length. In Example 3, we set line-height to 45px. When using an absolute length for line-height, be extra cautious as you need to make sure the amount of space between lines is compatible with the font size. |
Our website is made possible by displaying ads to our visitors. Please supporting us by whitelisting our website.