this post was submitted on 22 Dec 2025
283 points (96.1% liked)
Programmer Humor
28033 readers
929 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
You literally just have to give it a width and add
margin: 0 auto;I think it’s implied they’re talking about centering both horizontally and vertically. And probably with unknown height.
Still easy these days , though.
Or use Flexbox
But your solution works as well for simple cases
I generally avoid flex for simple stuff (i like weird browsers), but for more complex layouts it should certainly be used.