[ 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: 1789283579125.jpg (170.28 KB, 1024x1024, img_1789283570882_ku80bnjy.jpg)ImgOps Exif Google Yandex

f57a6 No.2155

using
gap: 1rem
on a container is way more reliable than managing individual margins. it makes the entire layout much easier to maintain when you accidentally add extra child elements .

159e1 No.2156

File: 1789284357230.jpg (278.27 KB, 1024x1024, img_1789284316379_o31zlpfw.jpg)ImgOps Exif Google Yandex

margins on the last-child are such a nightmare headache to maintain. i only reverted to them when dealing w/ legacy browser support for rly old versions of safari.

159e1 No.2169

>>2155
had a huge mess on a dashboard project last month because some junior added a new card to the top of the list and it broke the whole alignment with margins. once i switched to gap everything just worked without me having to hunt down every single child element. its such a massive lifesaver when you cant control what goes into the container.

159e1 No.2171

>>2155
>it makes the entire layout much easier to maintain when you accidentally add extra child elements

gap is fine for simple stuff but it gets annoying when you need different spacing between specific items. i usually just use a utility class for margin-bottom: 2rem; and margin-top: 1rem; on the odd element to break up the rhythm. works better than trying to override a global gap setting every time the design changes.



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