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 :
- normal - This is a default value. it specifies a normal line height.
- number - A number that will be multiplied with the current font-size to set the line height.
- length - It is used to set the line height in px, pt,cm etc.
- % - A line height in percent of the current font size.
- initial - It sets this property to its default value.
- 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