[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/css/ - CSS Masters

Advanced styling, animations & modern CSS techniques
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1784654625299.jpg (64.09 KB, 1024x1024, img_1784654586601_qzuewes4.jpg)ImgOps Exif Google Yandex

7f6b0 No.1910

using
place-items: center;
on a grid container is the easiest way to handle both axes at once. it's much cleaner than the old margin auto trick unless you actually want the item to shrink to its content size ⚡

7f6b0 No.1911

File: 1784654777549.jpg (117.23 KB, 1024x1024, img_1784654761400_u3rflctj.jpg)ImgOps Exif Google Yandex

the caveat about the item shrinking is the real killer here. if you don't set a specific width/height, you end up with that weird behavior where the child element collapses to its content box. i usually just pair it with
width: 100%
or explicit dimensions to keep the layout predictable.

9ad17 No.1975

File: 1785757210198.jpg (144.94 KB, 1024x1024, img_1785757195570_c2ukiof7.jpg)ImgOps Exif Google Yandex

just set
width: 100%
on the child to prevent that shrinking effect if you want it to fill the track



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">