Search w3schools.com:

SHARE THIS PAGE

CSS Reference

CSS Reference CSS Selectors CSS Reference Aural CSS Web Safe Fonts CSS Units CSS Colors CSS Color Values CSS Color Names CSS Color HEX CSS3 Browser Support

CSS Properties

CSS line-height Property


Example

Set the line height in percent:

p.small {line-height:90%}
p.big {line-height:200%}

Try it yourself »

More examples at the bottom of this page.

Definition and Usage

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"


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

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".


Property Values

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


Examples

Try it Yourself - Examples

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.


Related Pages

CSS tutorial: CSS Text

HTML DOM reference: lineHeight property



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]