Home » CSS Tutorial » CSS Properties » line-height
line-height
CSS Property Info :
| Syntax: |
line-height: <value> |
| Possible Values: |
normal | <number> | <length> | <percentage> |
| Initial Value: |
normal |
| Applies to: |
All elements |
| Inherited: |
Yes |
CSS Browser Support :
Internet Explorer 3+
Netscape 4+
Opera 3.6+
W3C's CSS Level 1+
CSS Property Description :
The line-height property will accept a value to control the spacing between baselines of text. When the value is a number, the line height is calculated by multiplying the element's font size by the number. Percentage values are relative to the element's font size. Negative values are not permitted.
Line height may also be given in the font property along with a font size.
The line-height property could be used to double space text:
P { line-height: 200% }
CSS Bugs / Problems :
Microsoft Internet Explorer 3.x incorrectly treats number values and values with em or ex units as pixel values. This bug can easily make pages unreadable, and so authors should avoid provoking it wherever possible; pixels units are often a good choice (more...).
For some reason, Opera 4 will 'inherit' inline absolute (as well as pixels) line height declarations back up to the previous line. Thus if you specify line-height: 200px on an inline element, it will also affect text on the previous and following lines.
Adapted by style-sheets.com, maker of Style Studio, powerful CSS Editor for Windows.
Copyright © John Pozadzides and Liam Quinn. All rights reserved.
Home » CSS Tutorial » CSS Properties » line-height
|