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


Picture showing the output of Line-Height property in CSS
Click to Enlarge


Browser Support


Internet ExplorerFirefoxChromeSafariOperaEdge
4.01.01.01.07.0Yes



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

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250