CSS Line-Height Property

In this chapter you will learn:
What is line-height property
Values of this property
Example of this property
CSS line-height property is used to specify the height of line. This property increase or decrease the height between two or more lines of the element. If you want that all line of the element display in some distance given by you then you can use this property.
Values of this property:
Value Description
normal It is the default value which is used to display a normal line.
length Used to fix the line height in px, pt, em etc.
% Fix line height in % of corrent font-size
initial Sets the default value

Example of this property:
<html>
<head>
    <title>Example of line-height property</title>
    <style type="text/css">
         
            #a
            {
                  line-height:35px;
            } 
</style>
</head>
<body>
<p>
This is the example of line-height property.<br/>
This is the example of line-height property.
</p>
<p id="a">
This is the example of line-height property.<br/>
This is the example of line-height property.
</p>
</body>
</html>

Guide:-
If you will run the given program then you will get that the text line of a simple paragraph is normal or default but the paragraph whose id is "a" has more distances in line height. This has done due to line-height property.
Output:- example of line-height property

Summary

In this chapter, you have learned about line-height property with a given program so try to write a program for yourself and use this property. Some properties are given in next chapter so click on Next button to continue-

More Articles

 

Share your thought



PLEASE DISABLE ADBLOCKER AND SUPPORT US!

Please support us by enabling ads on this page. Refresh

YOU DON'T LIKE ADS, WE ALSO DON'T LIKE ADS!
 
But we have to show ads on our site to keep it free and updated. We have to pay huge server costs, domain costs, CDN Costs, Developer Costs, Electricity and Internet Bill. Your little contribution will encourage us to regularly update this site.