gap vs margin (spacing) Playground

Mrs. Yanti’s display board: space the goods with margins, :not(:last-child), the owl, or gap, in flex, grid or block flow, and the browser measures what is…

Why it matters

"Use gap, not margin" is modern layout advice, but most people only see why after meeting the edge leftovers, a menu that is not really centred, a messy wrap, and a space that suddenly doubles when block becomes flex. gap also does not care about order or hidden items, while :not(:last-child) depends on HTML order.

The key idea

margin sticks to items, gap only lives between them

Common mistakes

Try it in this playground