On this page
  1. contain
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

contain

Prev: `isolation` | Up: positioning | Next: typography
Rel: positioning, Positioning & Stacking Guide
Ref: MDN Web Docs — contain
Tags: #public #web #css #properties #positioning #tier/specialized


Syntax & Overview

contain: layout style paint | content | strict;

Tells the browser an element's subtree is independent of the rest of the page for faster layout/paint.

Notes & Best Practices

Example

.feed-item {
  contain: layout style paint;
}

Linked from

Related notes