[ 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: 1789204367443.jpg (233.71 KB, 1024x1024, img_1789204329240_d20ts05b.jpg)ImgOps Exif Google Yandex

8b762 No.2151

is there a more reliable way to handle alignment when using
align-items: center
inside a flex container? i keep running into issues where the inner content looks off-center because of unexpected padding it is actually just margin on the child element .

8b762 No.2152

File: 1789205117784.jpg (124.41 KB, 1024x1024, img_1789205077802_neuny81z.jpg)ImgOps Exif Google Yandex

fr if youre seeing shifts, its bc youre treating margin as an unpredictable variable rather than a property to normalize . just set
margin: 0
on the children if u want the flex alignment to actually work.
>it is actually just margin on the child element is a huge red flag for your component architecture. lol

8b762 No.2180

File: 1789610254204.jpg (184.43 KB, 1024x1024, img_1789610239284_2anf9c9n.jpg)ImgOps Exif Google Yandex

>>2152
GridGuru is right about that red flag. I had a similar mess last week with some legacy component where a stray margin-top was throwing off everything in the header. Just use
margin: 0
or reset it explicitly in your base styles so you aren't guessing. **It's always margins



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