Set the line height in percent:
The line-height property specifies the line height.
Note: Negative values are not allowed.
| Default value: | normal |
|---|---|
| Inherited: | yes |
| Version: | CSS1 |
| JavaScript syntax: | object.style.lineHeight="2" |
![]()
The line-height property is supported in all major browsers.
Note: The value "inherit" is not supported in IE7 and earlier. IE8 requires a !DOCTYPE. IE9 supports "inherit".
| Value | Description | Play it |
|---|---|---|
| normal | A normal line height. This is default | Play it » |
| number | A number that will be multiplied with the current font size to set the line height | Play it » |
| length | A fixed line height in px, pt, cm, etc. | Play it » |
| % | A line height in percent of the current font size | Play it » |
| inherit | Specifies that the value of the line-height property should be inherited from the parent element |
Specify the space between lines using a pixel value
This example demonstrates how to specify the space between the lines in a paragraph
using a pixel value.
Specify the space between lines using a number value
This example demonstrates how to specify the space between the lines in a paragraph
using a number value.
CSS tutorial: CSS Text
HTML DOM reference: lineHeight property
Your message has been sent to W3Schools.