CSS Line Height


Prev Tutorial Next Tutorial

CSS Line Height

CSS Line Height properties are used for give sufficient space between two line of text on web page. The CSS line height property is used to define the minimal height of line boxes within the element because every text display on web page in the corm of box.

CSS line-height values

ValueDescription
normalThis is a default value. it specifies a normal line height.
numberIt specifies a number that is multiplied with the current font size to set the line height.
lengthIt is used to set the line height in px, pt,cm,etc.
%It specifies the line height in percent of the current font.
initialIt sets this property to its default value.
inheritIt inherits this property from its parent element.

Example

<!DOCTYPE html>  
<html>  
<head>  
<style>  
p.small {  
    line-height: 80%;  
}  
p.big {  
    line-height: 200%;  
}   
</style>  
</head>  
<body>  
<p class="small">This is my first html with css code<br/>
css is always apply on html elements. <br/> 
css is simple and easy to learn</p>  
<p class="big">This is my first html with css code<br/>
css is always apply on html elements. <br/> 
css is simple and easy to learn</p>  
</body>  
</html>

Result

This is my first html with css code
css is always apply on html elements.
css is simple and easy to learn

This is my first html with css code
css is always apply on html elements.
css is simple and easy to learn

Browser supported

Properties
line-heightYesYesYesYesYes

Prev Tutorial Next Tutorial

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain, Tutorialday.com, SeosmoTools.com @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: hitesh.xc@gmail.com WhatsApp no. 8882538826

Yahoo Advertisements