Container Type

Set the type of containment used for a container query.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari

Usage

Inline Size

Establish a query container for dimensional queries on the inline axis.

<div class="ct-is ...">
<!-- Container query target -->
</div>

Size

Establish a query container for dimensional queries on both the inline & block axes.

<div class="ct-s ...">
<!-- Container query target -->
</div>

None

The element is not a query container.

<div class="ct-none ...">
<!-- Not a container -->
</div>

Responsiveness

Target viewport sizes with breakpoint prefixes.

sm:ct-*
Small640px
md:ct-*
Medium768px
lg:ct-*
Large1024px
xxl:ct-*
Extra Large1536px

Hover State

Apply styles conditionally on hover using the h: prefix.

Add the h: prefix to apply styles only when the user hovers over the element.

Syntax:h:ct-*