this post was submitted on 07 May 2025
1145 points (96.7% liked)

Programmer Humor

24450 readers
58 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] 44 points 1 month ago (32 children)

Okay but how do u center a div in 2025

[–] [email protected] 17 points 1 month ago (17 children)

If using plain CSS, usually it's enough to set width appropriately, and margin-left and margin-right to auto.

If using a Modern Frontend/CSS Framework, then may God have mercy on your poor soul.

(Seriously I just started a new project with TailwindCSS and I'm so confused. But not entirely desperate yet.)

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

w-... mx-auto, replace the 3 dots with your desired width value, and that's it with tailwind

load more comments (16 replies)
load more comments (30 replies)