CSS Line Height
Advertisements
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
Value | Description |
---|---|
normal | This is a default value. it specifies a normal line height. |
number | It specifies a number that is multiplied with the current font size to set the line height. |
length | It is used to set the line height in px, pt,cm,etc. |
% | It specifies the line height in percent of the current font. |
initial | It sets this property to its default value. |
inherit | It 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-height | Yes | Yes | Yes | Yes | Yes |
Google Advertisment