Setting Line Height using CSS

CSSWeb DevelopmentFront End Technology

To set line height, use the line-height property. Followng are the property values −

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

Example

Let us now see an example −

 Live Demo

<!DOCTYPE html>
<html>
<head>
<style>
div {
   line-height: 1.9;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<div>
<p>This is demo text.<br>
This is another demo text.
</p>
</div>
</body>
</html>

Output

Example

Let us now see another example −

 Live Demo

<!DOCTYPE html>
<html>
<head>
<style>
div {
   line-height: 200%;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<div>
<p>This is demo text.<br>
This is another demo text.
</p>
</div>
</body>
</html>

Output

raja
Published on 30-Dec-2019 12:08:47
Advertisements