container-name

Assigns a name to a container so that nested elements can style themselves based on that specific container's size or state.

It is documented as part of the CSS Conditional Rules, CSS Container Queries specification.

/* Syntax */
container-name: none;

/* Global values */
container-name: inherit;
container-name: initial;
container-name: revert;
container-name: revert-layer;
container-name: unset;
Widely available Since 2023 93% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2023.

105+
110+
16+
105+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC