---
title: "You might need to know about the CSS lh unit"
url: https://daily.dev/posts/you-might-need-to-know-about-the-css-lh-unit-zsbx52ajp
source_url: https://ishadeed.com/article/css-line-height-unit
type: article
source: "Ahmad Shadeed"
published: 2026-08-01T14:03:34.074Z
updated: 2026-08-02T05:18:00.978Z
tags: ["webdev", "css"]
reading_time: 6
upvotes: 2
comments: 1
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# You might need to know about the CSS lh unit

**[Ahmad Shadeed](https://daily.dev/sources/ishadeed)** · 6 min read · 2 upvotes · 1 comments

## Summary

The CSS `lh` unit equals the computed value of the `line-height` property and enables several practical layout techniques. Use cases covered include: setting paragraph margins proportional to line height, creating paper-line background effects that stay aligned when font size changes, rounding floated image heights to the nearest text line using `calc-size()` and `round()`, limiting list height to an exact number of lines with a matching fade mask, and sizing button icons relative to text. The unit solves problems that previously required pixel hacks or were difficult to maintain across font size changes.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://ishadeed.com/article/css-line-height-unit>

## Community discussion

Top comments from developers on daily.dev.

**@agustinbarrientos** · 0 upvotes

> The lined-paper demo finally gave me a reason to remember `lh`.

## Similar posts on daily.dev

- [The Best CSS Unit Might Be a Combination](https://daily.dev/posts/the-best-css-unit-might-be-a-combination-3oswqao3v) · OddBird · 2 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#css](https://daily.dev/tags/css)

[View this post on daily.dev](https://daily.dev/posts/you-might-need-to-know-about-the-css-lh-unit-zsbx52ajp)
