No Login Data Private Local Save

CSS Grid Alignment Playground - Online Place & Align Tracks

8
0
0
0
Click an item to select it for place-self tuning
Grid Structure
Container Alignment
Advanced: individual properties
Item place-self (click item in preview)
Selected: None
Quick Presets
Generated CSS
Frequently Asked Questions

place-items is a shorthand property that sets both align-items (vertical alignment) and justify-items (horizontal alignment) for all grid items within their cells. For example, place-items: center; centers every item perfectly inside its grid cell. It accepts one or two values — one value applies to both axes, two values set align then justify separately.

place-items aligns individual grid items within their own cells. place-content aligns the entire grid inside its container when the container is larger than the grid tracks. Think of it as: place-items = item-level alignment inside cells; place-content = grid-level alignment inside the container's extra space.

place-self overrides the container's place-items for a specific grid item. It accepts the same values (auto | stretch | center | start | end). Use it to make one item behave differently — for instance, pin a single item to the top-left while others stay centered. Click any item in the preview above to assign it a custom place-self value.

Common patterns include: Perfect Centering (place-items: center; place-content: center;), Card Grid (place-items: stretch; with place-content: start;), Photo Gallery (place-content: space-evenly;), and Dashboard Layout (place-items: start stretch;). Try the Quick Presets above to see these patterns in action.

Yes! CSS Grid Layout (including place-items, place-content, and place-self) is supported in all modern browsers — Chrome 57+, Firefox 52+, Safari 10.1+, and Edge 16+. It covers over 97% of global web traffic. For older browsers like IE11, consider using feature queries (@supports) with flexbox fallbacks.

CSS Grid alignment properties (place-items, place-content, etc.) are discrete — they snap between values and cannot be smoothly animated with CSS transitions or keyframes. For animated layout changes, consider using transform on individual items or orchestrating changes with JavaScript libraries like GSAP or FLIP animations.