330
CSS finally adds vertical centering in 2024
(build-your-own.org)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
Well, we've been vertically centring content with no-trick pure CSS for years now, so, good I guess?
What do you mean? How else would you center content without CSS?
There were tons of options with multiple HTML elements with a sequence of CSS properties to reliably provide vertical centering (and also use vertical space at the same time) back in the days.
Now, between flex and grid (mainly flex for me, I find them more convenient) all the HTML scaffolding we used to make this work can be removed to get the same result. That's what I mean with "no trick".
Oh, I thought you meant you were centering in some special way.