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

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] irelephant@programming.dev 4 points 2 days ago (2 children)

You literally just have to give it a width and add margin: 0 auto;

[–] humorlessrepost@lemmy.world 3 points 1 day ago* (last edited 1 day ago)

I think it’s implied they’re talking about centering both horizontally and vertically. And probably with unknown height.

Still easy these days , though.

[–] Witchfire@lemmy.world 2 points 2 days ago* (last edited 2 days ago) (1 children)

Or use Flexbox

But your solution works as well for simple cases

[–] irelephant@programming.dev 1 points 21 hours ago

I generally avoid flex for simple stuff (i like weird browsers), but for more complex layouts it should certainly be used.