CSS containment
type: TechArticle
description: Use `contain: layout paint style` (or the `contain: content` shorthand) to tell the browser that an element's internals cannot affect the rest of the page, so reflow and repaint stay isolated to that subtree.
language: en
is part of: Web Specification Studio
author: Web Specification Studio
publisher: Web Specification Studio
license: https://creativecommons.org/licenses/by/4.0/
date modified: 2026-05-29T16:40:22.000Z
citation: CSS Containment Module Level 2
  type: CreativeWork
  publisher: W3C
citation: MDN — contain
  type: CreativeWork
  publisher: MDN
citation: web.dev — content-visibility: boost rendering performance
  type: CreativeWork
  publisher: Google

Web Specification Studio
type: WebSite

Web Specification Studio
type: Organization

breadcrumb
type: BreadcrumbList
item list element: Home
  type: ListItem
  position: 1
  item: https://webspecification.com/
item list element: Spec
  type: ListItem
  position: 2
  item: https://webspecification.com/spec/
item list element: Performance
  type: ListItem
  position: 3
  item: https://webspecification.com/spec/performance/
item list element: CSS containment
  type: ListItem
  position: 4
  item: https://webspecification.com/spec/performance/css-containment/