1154
you are viewing a single comment's thread
view the rest of the comments
[-] obinice@lemmy.world 45 points 1 year ago

Okay but how do u center a div in 2025

[-] impedans@lemmy.world 10 points 1 year ago* (last edited 1 year ago)

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.

[-] FooBarrington@lemmy.world 8 points 1 year ago
[-] impedans@lemmy.world 4 points 1 year 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

load more comments (1 replies)
load more comments (29 replies)
this post was submitted on 07 May 2025
1154 points (96.8% liked)

Programmer Humor

33096 readers
613 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 3 years ago
MODERATORS