The CSS `margin-trim` property lets a container element trim the margins of its children where they meet the container's edges. This elegantly solves the classic problem of unwanted trailing margin on the last child element — previously handled via `:last-child` overrides, `:not(:last-child)` selectors, or the lobotomized owl selector. The property accepts values like `none`, `block`, `block-start`, `block-end`, `inline`, `inline-start`, and `inline-end`. Currently only supported in Safari Technology Preview.

2m read timeFrom matuzo.at
Post cover image