margin-trim

Draft
This page is not complete.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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

Syntax not found in DB!

Specifications

Specification Status Comment
CSS Basic Box Model
The definition of 'margin-trim' in that specification.
Working Draft Initial definition.

Value not found in DB!

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