margin-trim

Draft
This page is not complete.

The margin-trim property allows the container to trim the margins of its children where they adjoin the container’s edges.

Syntax

none
Margins are not trimmed by the container.
in-flow

For in-flow boxes contained by this box, block-axis margins adjacent to the box's edges are truncated to zero.

It also truncates any margins collapsed with such a margin.

all
Trims the margins of in-flow boxes and floats whose margins coincide with the container's content edge.

Formal syntax

none | in-flow | all

Specifications

Specification Status Comment
CSS Box Model Module Level 4
Initial valuenone
Applies toBlock containers and multi-column containers. It also applies to ::first-letter and ::first-line.
Inheritedno
Computed valueas specified
Animation typediscrete

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
margin-trim
Experimental
Chrome No support NoEdge No support NoFirefox No support No
Notes
No support No
Notes
Notes See bug 1506241.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android No support No
Notes
No support No
Notes
Notes See bug 1506241.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.

See also