place-items

A shorthand property that sets align-items and justify-items at once. Just two classes dg pic enable perfect centering.

Class List

ClassCSSDescription
pisplace-items: startPlace at cell start (top-left)
picplace-items: centerPlace at cell center. Simplest centering!
pieplace-items: endPlace at cell end (bottom-right)
pistplace-items: stretchFill entire cell (default)

Visual Comparison

Compares how each place-items value affects grid item positioning. Dotted lines indicate grid cell areas.

Start — pis

A
B

Top-left alignment. Items take content size only

Center — pic

A
B

Center alignment. Most commonly used pattern!

End — pie

A
B

Bottom-right alignment

Stretch (default value) — pist

A
B

Fill entire cell. Default behavior even without explicit declaration

Easiest Centering

The dg pic combination is the simplest centering method in CSS. One class fewer than df jcc aic.

Grid method -- dg pic

가운데!

Perfect centering with 2 classes

Flex method -- df jcc aic

가운데!

Requires 3 classes (same result)

dg picdf jcc aic
Number of classes2개 (dg pic)3개 (df jcc aic)
Layout modelGridFlexbox
Multiple child placement각각 셀 중앙에 배치한 줄에 모여서 중앙
Full-screen centerdg pic h100vhdf jcc aic h100vh
Common Use Cases단일 요소 센터링, 그리드 내 정렬여러 요소의 가로/세로 정렬

When to Use What?

SituationRecommendedReason
전체 화면 가운데 정렬dg pic h100vh가장 간결한 센터링 (3 클래스)
로딩 스피너, 빈 상태dg pic단일 요소 정중앙 배치에 최적
그리드 아이템 시작점 정렬pis아이템을 셀의 왼쪽 위에 배치
그리드 아이템 끝점 정렬pie아이템을 셀의 오른쪽 아래에 배치
기본값으로 되돌리기piststretch로 복원 (pic/pis에서 전환)

Class Details

pisplace-items: start

Places all grid items at the start point (top-left) of the cell. Items only take up their content size; remaining space is left empty.

<!-- Place grid items at start -->
<div class="dg gtcr3-1fr pis gap16px h30rem">
  <div class="bg18181B p16px br8px">Top left</div>
  <div class="bg18181B p16px br8px">Top left</div>
  <div class="bg18181B p16px br8px">Top left</div>
</div>

start placement

A
B
C

All items positioned at top-left of the cell

picplace-items: center

Places all grid items at the exact center of the cell. The simplest centering method -- just 3 classes dg pic h100vh complete full-screen centering.

<!-- Fullscreen center aligned (most concise!) -->
<div class="dg pic h100vh">
  <div class="tac">
    <h1 class="fs3-6rem fw800 cFAFAFA">404</h1>
    <p class="c71717A mt8px">Page not found</p>
  </div>
</div>

<!-- Loading spinner -->
<div class="dg pic h40rem">
  <div class="w4rem h4rem b4pxsolid27272A bt4pxsolid6366F1 br50p"></div>
</div>

<!-- Card inner centering -->
<div class="dg gtcr3-1fr gap16px">
  <div class="dg pic h20rem bg18181B br8px">
    <span class="fs4-8rem">🎯</span>
  </div>
  <div class="dg pic h20rem bg18181B br8px">
    <span class="fs4-8rem">🚀</span>
  </div>
  <div class="dg pic h20rem bg18181B br8px">
    <span class="fs4-8rem">✨</span>
  </div>
</div>

Common Combinations

dg pic h100vhFull-screen centering (404 page, loading, etc.)
dg pic h40remCentering within a fixed-height area
dg pic minh50vhMinimum height guarantee + centering
dg gtcr3-1fr pic3-column grid with centering inside each cell

pieplace-items: end

Places all grid items at the end point (bottom-right) of the cell. Items only take up their content size.

<!-- Place grid items at end -->
<div class="dg gtcr3-1fr pie gap16px h30rem">
  <div class="bg18181B p16px br8px">Bottom right</div>
  <div class="bg18181B p16px br8px">Bottom right</div>
  <div class="bg18181B p16px br8px">Bottom right</div>
</div>

<!-- Place button in footer area -->
<div class="dg pie h20rem bg18181B br8px p2rem">
  <button class="bg6366F1 cFFFFFF py8px px16px br8px bn cp">Confirm</button>
</div>

end placement

A
B
C

All items positioned at bottom-right of the cell

pistplace-items: stretch

Grid items stretch to fill the entire cell. Since this is the grid default, it rarely needs to be set explicitly, but is used to revert from pis or pic.

<!-- stretch (restore default) -->
<div class="dg gtcr3-1fr pist gap16px h20rem">
  <div class="bg18181B p16px br8px df aic jcc">Fill all</div>
  <div class="bg27272A p16px br8px df aic jcc">Fill all</div>
  <div class="bg18181B p16px br8px df aic jcc">Fill all</div>
</div>

<!-- Responsive: Desktop center → Mobile stretch -->
<div class="dg gtcr3-1fr pic sm-pist gap16px">
  <div class="bg18181B p16px br8px">Responsive alignment</div>
  <div class="bg27272A p16px br8px">Responsive alignment</div>
  <div class="bg18181B p16px br8px">Responsive alignment</div>
</div>

stretch placement (default value)

A
B
C

Items fill the entire cell

Responsive Usage

Combine with media query prefixes to change alignment based on screen size.

<!-- Desktop: center → Mobile: stretch -->
<div class="dg gtcr3-1fr pic sm-pist gap16px">
  <div class="bg18181B p16px br8px">Card</div>
  <div class="bg18181B p16px br8px">Card</div>
  <div class="bg18181B p16px br8px">Card</div>
</div>

<!-- Fullscreen center: start alignment on mobile -->
<div class="dg pic sm-pis h100vh sm-ha p2rem">
  <div class="tac sm-tal">
    <h1>Content</h1>
  </div>
</div>
Class CombinationBehavior
pic sm-pistDefault center -> stretch below 768px
pic sm-pisDefault center -> start below 768px
pis md-picDefault start -> center below 1024px
pie sm-pistDefault end -> stretch below 768px

Tips & Notes

pic: most concise centering

dg pic is the least code centering method in CSS. Use it actively for loading spinners, error pages, empty states, etc.

Grid-only property

place-items must be used with dg (display: grid). For df (display: flex), use jcc aic.

stretch is the default

The default place-items for grid items is stretch. Using pic or pis shrinks items to content size, so add w100p if full width is needed.