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

Programmer Humor

23365 readers
1828 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
[–] obinice@lemmy.world 46 points 1 week ago (33 children)

Okay but how do u center a div in 2025

[–] umbraroze@slrpnk.net 17 points 1 week 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.)

[–] lord_ryvan@ttrpg.network 1 points 6 days ago

My brother in Christ TailwindCSS just gives classes that let you do inline styling in a shorter syntax! (and theme configuration, but mostly inline styling)

Replace width: ...px with w-..., margin-left: ... with ml-... and margin-right: ... with mr-.... Setting both horizontal margins is mx-... and both vertical margins is my-....

If you can do inline styling, TW just makes the syntax a bit shorter, but that's it, really.

load more comments (16 replies)
load more comments (31 replies)