That's fine but it only centres horizontally. Usually when people talk about "the div centring problem" they mean x and y, dead centre (as this article is).
I disagree that's what people mean by "Centering a div" and the hilariously repetitive corpus of programmerhumor jokes on the matter seem to disagree too.
And in either case, I don't think the article fully agrees either, since the thesis of it relates to a strictly horizontal element. If the article doesn't intend to disagree, then it was just a framing device they used in the writing that has some distractions regarding the vertical component unfortunately attached.
Oh really? I always assumed as I never thought horizontally centring was ever a huge problem. Vertical was the actual hard thing for a long time (which is something table cells could easily do since the beginning).
You caught me in that I didn't read the full article, but I read enough to see that it has this CSS which centres on both axes:
body {
display: grid;
min-height: 100dvh;
place-items: center;
}
The article only seems to very briefly mention the vertical axis, with pretty much all of it focusing on interactions with the sidebar (which only affects the horizontal width).
That's fine but it only centres horizontally. Usually when people talk about "the div centring problem" they mean x and y, dead centre (as this article is).
I disagree that's what people mean by "Centering a div" and the hilariously repetitive corpus of programmerhumor jokes on the matter seem to disagree too.
And in either case, I don't think the article fully agrees either, since the thesis of it relates to a strictly horizontal element. If the article doesn't intend to disagree, then it was just a framing device they used in the writing that has some distractions regarding the vertical component unfortunately attached.
Oh really? I always assumed as I never thought horizontally centring was ever a huge problem. Vertical was the actual hard thing for a long time (which is something table cells could easily do since the beginning).
You caught me in that I didn't read the full article, but I read enough to see that it has this CSS which centres on both axes:
The article only seems to very briefly mention the vertical axis, with pretty much all of it focusing on interactions with the sidebar (which only affects the horizontal width).