Articles → CSS → Line-Height Property In CSS
Line-Height Property In CSS
Purpose
Syntax
line-height: normal|number|length|initial|inherit;
Property Values
Value | Description |
---|
Normal | Default value of line-height |
Number | Number multiplied with current font size is set as line height. |
Length | Fixed line-height in px, pt etc. |
% | Line height in percentage of current font size |
Initial | Set the line-height to the default value |
Inherit | Inherit 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 Explorer | Firefox | Chrome | Safari | Opera | Edge |
---|
4.0 | 1.0 | 1.0 | 1.0 | 7.0 | Yes |