← TechnologyThe essentials of

contain: paint limits where descendants can be painted

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 13:48. This is not editorial approval.

In a few sentences

In brief

The declaration creates a boundary for the visual content.

Useful to know

contain: paint tells the browser that descendants are drawn within the bounds of the element. Content that would go beyond them is cut according to the paint containment. [1] rules

This is a useful reason to check menus and decorative parts before adding containment to a map. A drop-down list that needs to go off the map may become invisible . contain has other types associated with size and arrangement; they are not interchangeable. Choose a specific constraint whose consequences correspond to the component.

Sources

For further detail and to check the information:

  1. [1] MDN — contain ↗