Centering a CSS grid

I’m trying to to place the grid beneath “Portfolio” in the centre of the page. I’ve wrapped it in a div and gave it “text-align: center” but it doesn’t want to work. Any help? project

1 Like

Grid and flexbox have justify-content and align-items for centering.

.container {
  justify-content: center;

Could have sworn I tried that but I guess not lol. Thanks!

also look at the difference between justify-content and justify-items both are valid parameters in css grid, they work slightly different based on the circumstances.

Will definitely give it a read, thanks!

It is an awesome resource, they also have an equivalent article for flex-box. also worth the bookmark.