Why should line-height be unitless in CSS?
You might have heard that line-height
should be unitless, but do you know why?
The CSS snippet collection contains utilities and interactive examples for CSS3. It includes modern techniques for creating commonly-used layouts, styling and animating elements, as well as snippets for handling user interactions.
You might have heard that line-height
should be unitless, but do you know why?
Vertically and horizontally centers a child element within its parent element, using display: table
.
Vertically and horizontally centers a child element within its parent element using CSS transforms.
Learn everything you need to know about CSS units with this handy cheatsheet.