CSS Line-height Properties
CSS Reference Manual example
To set the row height as a percentage:
P.small {line-height:90%}
p.big {line-height:200%}
Give it a shot yourself.
(You can see more instances at the bottom of the page) browser support
IE |
Firefox |
Chrome |
Safari |
Opera |
|
|
|
|
|
All browsers support the Line-height property.
Note: The property value "Inherit" is not supported for any version of Internet Explorer (including IE8). Definitions and Usage
The Line-height property sets the distance (row height) between rows.
Note: Negative values are not allowed. Description
This property affects the layout of the row box. When applied to a block-level element, it defines the minimum distance, not the maximum distance, between the baselines in the element.
The difference between the calculated value of Line-height and font-size (becoming "line spacing" in CSS) is divided into two halves, added to the top and bottom of a text line. The smallest box that can contain the content is the row box.
The original numeric value specifies a scaling factor, and the descendant element inherits the scaling factor rather than the computed value.
Default value: |
Normal |
Inheritance: |
Yes |
Version: |
CSS1 |
JavaScript Syntax: |
Object.style.lineheight= "2" |
Possible values
value |
Description |
Normal |
Default. Set reasonable line spacing. |
Number |
Sets the number that is multiplied by the current font size to set the line spacing. |
Length |
Sets the fixed line spacing. |
% |
The percent line spacing based on the current font size. |
Inherit |
Specify that the value of the Line-height attribute should be inherited from the parent element. |
Tiy InstanceUse percentages to set line spacing This example shows how to use percent values to set the spacing between lines in a paragraph. Set line spacing using pixel values This example shows how to use pixel values to set the line spacing in a paragraph. Use numeric values to set line spacing This example shows how to use a numeric value to set the line spacing in a paragraph.
related pages
CSS Tutorial: CSS text
HTML DOM Reference manual: Lineheight Properties
CSS Reference Manual