# Container Type

Make an element a container its children can query.

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

Chrome 105 · Edge 105 · Firefox 110 · Safari 16

| Class | Properties | Value |
|-------|------------|-------|
| `ct:is` | container-type | `inline-size` |
| `ct:n` | container-type | `normal` |
| `ct:s` | container-type | `size` |

> **Note**
>
> A container on its own does nothing visible. Its children respond to it with
> [Container Queries](/docs/container-queries).

## Variants

Prefix any class with a variant to apply it only under that condition. Variants stack, as in `@md:h:ct:n`.

### Breakpoints

Apply a class from a viewport width up. Each breakpoint covers its width & every width above it.

| Class | Applies |
|-------|---------|
| `@xs:ct:n` | From 32rem up. |
| `@sm:ct:n` | From 40rem up. |
| `@md:ct:n` | From 48rem up. |
| `@lg:ct:n` | From 64rem up. |
| `@xl:ct:n` | From 80rem up. |
| `@xxl:ct:n` | From 96rem up. |

### Containers

Apply a class from a container's width up, not the viewport's. Mark the parent with `ct:is` first.

| Class | Applies |
|-------|---------|
| `@c:xs:ct:n` | Container from 32rem up. |
| `@c:sm:ct:n` | Container from 40rem up. |
| `@c:md:ct:n` | Container from 48rem up. |
| `@c:lg:ct:n` | Container from 64rem up. |
| `@c:xl:ct:n` | Container from 80rem up. |
| `@c:xxl:ct:n` | Container from 96rem up. |

### Media

Apply a class when the device or the page matches a condition, or on the first frame an element renders.

| Class | Applies |
|-------|---------|
| `@pc:ct:n` | On a touch screen. |
| `@prm:ct:n` | With reduced motion on. |
| `@st:ct:n` | On the first frame. |

### States

Apply a class only while the element is in a state, such as hovered, focused or checked.

| Class | Applies |
|-------|---------|
| `h:ct:n` | On :hover. |
| `f:ct:n` | On :focus. |
| `fv:ct:n` | On :focus-visible. |
| `a:ct:n` | On :active. |
| `d:ct:n` | On :disabled. |
| `fc:ct:n` | On :first-child. |
| `c:ct:n` | On :checked. |
| `e:ct:n` | On :empty. |
| `fw:ct:n` | On :focus-within. |
| `i:ct:n` | On :invalid. |
| `in:ct:n` | On :indeterminate. |
| `lc:ct:n` | On :last-child. |
| `nc:ct:n` | On :nth-child. |
| `r:ct:n` | On :required. |
| `ro:ct:n` | On :read-only. |
| `v:ct:n` | On :valid. |

### Pseudo Elements

Style a part of the element rather than the element itself, such as its placeholder or the selected text.

| Class | Applies |
|-------|---------|
| `a::ct:n` | On ::after. |
| `b::ct:n` | On ::before. |
| `p::ct:n` | On ::placeholder. |
| `s::ct:n` | On ::selection. |