CSS Line Height

Advertisements

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 Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements