On this page
line-height
Prev: `font-size` | Up: typography | Next: `text-wrap`
Rel: typography, Typography & Color Guide
Ref: MDN Web Docs — line-height
Tags: #public #web #css #properties #typography #tier/core
Syntax & Overview
line-height: 1.5;
Sets line box height; always use unitless numbers so children inherit the ratio.
- Initial:
normal| Inherited: Yes | Animatable: Yes
Notes & Best Practices
- Always use unitless numbers (
1.5,1.2): A length or percentage (150%) inherits the computed pixel value into child elements with different font sizes, causing cramped headings.
Example
body { line-height: 1.6; }
h1, h2, h3 { line-height: 1.2; }
Linked from
Related notes
- tuts/css/properties/typography/font-size Linked here; links to this page; shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/typography/text-wrap Linked here; links to this page; shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/typography Linked here; links to this page; shared tags: #css, #properties, #typography, #web
- tuts/css/properties/typography_and_color Linked here; shared tags: #css, #properties, #typography, #web
- tuts/css/properties/typography/accent-color shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/typography/color shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/typography/color-scheme shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/typography/font-family shared tags: #css, #properties, #tier, #typography, #web
- tuts/css/properties/box_model/aspect-ratio shared tags: #css, #properties, #tier, #web
- tuts/css/properties/box_model/box-sizing shared tags: #css, #properties, #tier, #web