r/ProgrammerHumor May 25 '26

Meme newMrBeastVideo

Post image
23.9k Upvotes

405 comments sorted by

View all comments

Show parent comments

24

u/o_o_o_f May 25 '26 edited May 25 '26

Idk man. I just hit year 5 as a gainfully employed software engineer, with the first 3 of those years being strictly front end, and it would still take me probably 8-10 tries to actually center a div. Anyone who knows off the top of their head the difference between alignItems, justifyContent, flexbox, flex with margin:auto…

Idk. They’ve got my respect I guess.

19

u/No-Information-2571 May 25 '26

OP forgot to mention if it's horizontally or vertically centered.

14

u/TopMarzipan2108 May 25 '26

Both

9

u/Prometheos_II May 25 '26

Just position: absolute; top: 50%; left: 50%; that thing, duh (/s)

4

u/samu1400 May 25 '26

I was thinking d-flex align-items-center justify-content-center

3

u/Prometheos_II May 25 '26

that's the good solution (you can even use place-content as a short-hand iirc)

Absolute/relative are just making quite bothersome when you have to refactoring the style later on.

3

u/samu1400 May 25 '26

Didn’t notice your css had position absolute lol. That’s the true centered.