# Grid Template Rows

Set the rows for a grid layout.

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

Chrome 57 · Edge 16 · Firefox 52 · Safari 10.1

| Class | Properties | Value |
|-------|------------|-------|
| `gtr:1` | grid-template-rows | `repeat(1, minmax(0, 1fr))` |
| `gtr:2` | grid-template-rows | `repeat(2, minmax(0, 1fr))` |
| `gtr:3` | grid-template-rows | `repeat(3, minmax(0, 1fr))` |
| `gtr:4` | grid-template-rows | `repeat(4, minmax(0, 1fr))` |
| `gtr:5` | grid-template-rows | `repeat(5, minmax(0, 1fr))` |
| `gtr:6` | grid-template-rows | `repeat(6, minmax(0, 1fr))` |
| `gtr:7` | grid-template-rows | `repeat(7, minmax(0, 1fr))` |
| `gtr:8` | grid-template-rows | `repeat(8, minmax(0, 1fr))` |
| `gtr:9` | grid-template-rows | `repeat(9, minmax(0, 1fr))` |
| `gtr:10` | grid-template-rows | `repeat(10, minmax(0, 1fr))` |
| `gtr:11` | grid-template-rows | `repeat(11, minmax(0, 1fr))` |
| `gtr:12` | grid-template-rows | `repeat(12, minmax(0, 1fr))` |
| `gtr:13` | grid-template-rows | `repeat(13, minmax(0, 1fr))` |
| `gtr:14` | grid-template-rows | `repeat(14, minmax(0, 1fr))` |
| `gtr:15` | grid-template-rows | `repeat(15, minmax(0, 1fr))` |
| `gtr:16` | grid-template-rows | `repeat(16, minmax(0, 1fr))` |
| `gtr:s` | grid-template-rows | `subgrid` |

## Variants

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

### Breakpoints

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

| Class | Applies |
|-------|---------|
| `@xs:gtr:4` | From 32rem up. |
| `@sm:gtr:4` | From 40rem up. |
| `@md:gtr:4` | From 48rem up. |
| `@lg:gtr:4` | From 64rem up. |
| `@xl:gtr:4` | From 80rem up. |
| `@xxl:gtr:4` | 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:gtr:4` | Container from 32rem up. |
| `@c:sm:gtr:4` | Container from 40rem up. |
| `@c:md:gtr:4` | Container from 48rem up. |
| `@c:lg:gtr:4` | Container from 64rem up. |
| `@c:xl:gtr:4` | Container from 80rem up. |
| `@c:xxl:gtr:4` | 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:gtr:4` | On a touch screen. |
| `@prm:gtr:4` | With reduced motion on. |
| `@st:gtr:4` | 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:gtr:4` | On :hover. |
| `f:gtr:4` | On :focus. |
| `fv:gtr:4` | On :focus-visible. |
| `a:gtr:4` | On :active. |
| `d:gtr:4` | On :disabled. |
| `fc:gtr:4` | On :first-child. |
| `c:gtr:4` | On :checked. |
| `e:gtr:4` | On :empty. |
| `fw:gtr:4` | On :focus-within. |
| `i:gtr:4` | On :invalid. |
| `in:gtr:4` | On :indeterminate. |
| `lc:gtr:4` | On :last-child. |
| `nc:gtr:4` | On :nth-child. |
| `r:gtr:4` | On :required. |
| `ro:gtr:4` | On :read-only. |
| `v:gtr:4` | 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::gtr:4` | On ::after. |
| `b::gtr:4` | On ::before. |
| `p::gtr:4` | On ::placeholder. |
| `s::gtr:4` | On ::selection. |