Articles → CSS → Line-Height property in CSS

Line-Height property in CSS






Purpose





Syntax


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



Property values


ValueDescription
NormalDefault value of line-height
NumberNumber multiplied with current font size is set as line height.
LengthFixed line-height in px, pt etc.
%Line height in percentage of current font size
InitialSet the line-height to the default value
InheritInherit the line-height from its parent element.



Example


<!DOCTYPE html>
<html>
<head>
    <title></title>    
</head>
<body>
    <div style="line-height:50px;">
        Welcome to Gyan Sangrah: A one stop shop for people preparing for technical interviews. Gyansangrah is an online resource comprising all the possible questions you may face during your technical interview round. Gyansangrah also provides you with live examples to make concepts easier to understand.
    </div>
</body>
</html>



Output



Click to Enlarge


Browser support


Internet ExplorerFirefoxChromeSafariOperaEdge
4.01.01.01.07.0Yes



Posted By  -  Karan Gupta
 
Posted On  -  Monday, November 06, 2017

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250