Display grid with place-content center is the optimal way to center an element in CSS.
One contestant chooses display grid with place-content center to center the main square, noting it as the right play. ✦ AI generated
CJ · Syntax · 2026-07-24 · original ↗
starts at this moment · 1:04
I might regret this, but I'm going to set it to be a flexbox so that it centers everything. Actually, if I do display grid place content center. Yeah, that's that's the play.
verbatim transcript · starts at 1:04
0:51this. I forget everything. Well, we're going to have a class of B on this one. So, okay, div with a class of A. This is going to be Shoot. I'm already [music] panicking because I forgot all of my tricks. >> I might regret this, but I'm going to set it to be a flexbox so that it centers everything. Actually, if I do display grid place content center.
1:12Yeah, that's that's the play. Let's also set the background color of the body like so. And then increase the width and height. I'm going to guess this is maybe like 300. No, that's way too much. 200 150. >> We're going to say border radius 50%. And then we're going to give this a bump up. We're going to say it's 200 pixels. Sure. We're going to say 150. Oh man, we
1:40don't have that much time. That's the whole thing is you got to move quick. Um position [music] fixed. And we're doing fixed because fixed is uh faster or smaller. Top 10 pics. [music] Um left negative 100 pix. So we want to do sorry not that far negative left. We want to say negative like 20 pix. Okay that's pretty good. Top again. This is going to be like negative like 50 60.