English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Basic Tutorial

CSS Box Model

CSS3Basic Tutorial

CSS Reference Manual

CSS @rules (RULES)

CSS line-height (line height)

CSS line-height line spacing propertyUsed forThe minimum height of the line box defined within the element. It sets the spacing between two lines of content.

It defines the space amount above and below an inline element. It allows you to set the line height independently of the font size.

CSS Line Height Value

line-The height property value is related to CSS line-The height property must be used together.

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

CSS Line Height Example

<!DOCTYPE html>  
<html>  
<head>  
<style>  
h3.small {  
    line-height: 70%;  
}  
h3.big {  
    line-height: 200%;  
}  
</style>  
</head>  
<body>  
<h3>  
This is a title with the default standard line spacing.<br>  
This is a title with the default standard line spacing.<br>  
The default line spacing in most browsers is approximately110%to120%.<br>  
</h3>  
<h3 class="small">  
This is a title with a small line spacing.<br>  
This is a title with a small line spacing.<br>  
This is a title with a small line spacing.<br>  
This is a title with a small line spacing.<br>  
</h3>  
<h3 class="big">  
This is a title with a large line spacing.<br>  
This is a title with a large line spacing.<br>  
This is a title with a large line spacing.<br>  
This is a title with a large line spacing.<br>  
</h3>  
</body>  
</html>
Test See‹/›