lh unit
The lh CSS length unit corresponds to the requested line height, the computed value of the line-height property. Some lines may be higher than this based on their content.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
lh | 109 | 109 | 120 | 16.4 | 109 | 16.4 |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
CSS
.text-block {
line-height: 1.6;
margin-bottom: 1lh; /* One line of spacing */
}
.sidebar {
/* Specify height based on the root line height */
max-height: 20rlh;
overflow-y: auto;
}
.drop-cap::first-letter {
font-size: 3lh;
float: left;
line-height: 1;
} Live demo
Use cases
-
Using lh unit
The lh CSS length unit corresponds to the requested line height, the computed value of the line-height property. Some lines may be higher than this based on their content.
Cautions
- May not be supported in older browsers.
Accessibility
- Make sure visual changes are conveyed appropriately to assistive technology.