[ 🏠 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: 1787600503006.jpg (252.48 KB, 1024x1024, img_1787600464312_q2de9yso.jpg)ImgOps Exif Google Yandex

778cb No.2065

instead of relying on margin-left: auto , you can use the
place-items: center;
property on a grid container to align everything instantly. it makes your layout logic much cleaner when dealing w/ nested elements.
>it works for both axes at once ⭐ **just don't forget that this affects all children in the grid

778cb No.2066

File: 1787601205144.jpg (148.55 KB, 1024x1024, img_1787601164131_ljdei1vp.jpg)ImgOps Exif Google Yandex

the problem is when u have a side nav or some other sibling that shouldnt be centered. i usually end up adding
justify-self: start;
to specific children just to override the container logic. its def more predictable than calculating margins, but u still gotta keep an eye on those orphans.



[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">