CSS Line Height

CSS Line Height line-height property is used to specify the height of a line. It defines the amount of space above and below inline elements. It allows you to set the height of a line of independently from the font size.

Syntax :

line-height: normal | number | length | initial | inherit;

Value :

  1. normal - This is a default value. it specifies a normal line height.
  2. number - A number that will be multiplied with the current font-size to set the line height.
  3. length - It is used to set the line height in px, pt,cm etc.
  4. % -    A line height in percent of the current font size.
  5. initial - It sets this property to its default value.
  6. inherit - It inherits this property from its parent element.

CSS Line Height Example :

<html>
<head>
    <title>Learn Css line height tutorials</title>
    <style>
    .txt
    {
        line-height:35px;
    }
    </style>
</head>
<body>
  <p class="txt">line-height property to set 35px height between two lines of your content.</p>
  <p class="txt">line-height property to set 35px height between two lines of your content.</p>
  <p class="txt">line-height property to set 35px height between two lines of your content.</p>
</body>
</html>

Output :

line-height property to set 35px height between two lines of your content.

 

line-height property to set 35px height between two lines of your content.

 

line-height property to set 35px height between two lines of your content.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

76976