rootMargin property

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

The margin around the intersection root. Similar to the CSS margin property.

This property is read-only.

Syntax

JavaScript
rootMargin = object.rootMargin

 

Property values

Type: DOMString

The margin around the intersection root.

Remarks

Default is "0px".

The rootMargin is a string of 1-4 components, either an absolute length or a percentage.

See also

IntersectionObserver