CSS GUIDE LINE HEIGHT
From Open Source@Seneca
This document is a work in progress and is subject to change.
Contents |
Summary
The line-height property specifies the height of an in-line element box.
| Applicability: | The line-height property can be used for all CSS elements. | |
| Media Group: | Visual | |
| Inherited: | Yes |
Syntax
TARGET_ELEMENT { line-height: value }
Legal Values
Values can be entered in 4 ways:
| Method | Example |
|---|---|
| normal | Sets set the computed value to a "reasonable" value based on the font size of the element |
| length | The box height is set to this length. |
| number | The box height is set to this number multiplied by the element's font size. |
| percentage | The box height is set to this percentage multiplied by the element's computed font size. |
See usage examples section for more details.
Mozilla Recommended Values
Usage Examples
TARGET_ELEMENT { line-height: 1.2; font-size: 10pt } /* number */
TARGET_ELEMENT { line-height: 1.2em; font-size: 10pt } /* length */
TARGET_ELEMENT { line-height: 120%; font-size: 10pt } /* percentage */
Notes
The World Wide Web Consortium (W3C) provides a free online CSS validation service.
