Hacker News new | ask | show | jobs
by antonkm 2300 days ago
Why not: .center { display: flex; justify-content: center; align-items: center; } ?
1 comments

Because I learned <center> like 20 years ago and it still works, while some of that I've only been exposed to in the last couple years (multiple "this is the right way to center" notions have come and gone since trusty ol' <center> became "bad") and I'd have much lower confidence it'd look the same in my browser as another.

[EDIT] I'm talking about situations like "we need an ugly informational page here for an hour" and all or some part of it would look better centered, or if I'm throwing up a placeholder page on a personal site. Those kinds of things, I'm not gonna google "what's the correct 2020 CSS to do what <center> does" and end up with a bunch of caveats and gotchas when I could just <center> and move on with my life.

The year is 2047, the ugly informational page is now a sprawling social network platform and is still in production.
And the latest browsers have finally finished implementing the 3D parallaxing layout system which has finally overtaken the other 6 layout systems. It takes a few more lines but it guarantees the compositing for AR is consistent regardless of surface. Meanwhile the center tag actually still just works.