this post was submitted on 07 May 2025
1139 points (96.8% liked)

Programmer Humor

23145 readers
1106 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
[–] [email protected] 10 points 2 days ago* (last edited 2 days ago) (2 children)

If you define what you mean by centering I'll give you a straight answer.

Vertically? Horizontally? Center the text or the entire box? Compared to the viewport, the parent container or the entire page?

"Centering" isn't as straight forward as you'd think, and what you actually want usually depends on the situation.

[–] [email protected] 4 points 1 day ago

Fuck it, align='center'. That'll center it horizontally relative to some context and if that's not good enough then you should have been more precise in your request.

[–] [email protected] 7 points 2 days ago (1 children)
[–] [email protected] 4 points 2 days ago

Yeah that works if you wanna center a box of content it relative to the parent container, either horizontally or vertically. For other situations we've got different tools