logoalt Hacker News

efortis12/04/20251 replyview on HN

Nice margin notes trick:

  float: right;
  margin-right: -12em;

Replies

pavpanchekhalast Thursday at 12:01 AM

Author here—it is from Tufte CSS. I have a blog post [1] about how floats work. It is a nice example of there being unintuitive and also more-intuitive ways to achieve things in CSS. These days I believe CSS Anchor Positioning provides a simpler way to do this, but I haven't used it yet.

[1]: https://pavpanchekha.com/blog/css-floats.html