Question about the css grid template

Hello everyone! :slight_smile:

I have a curiosity about the grid template:

it’s stated
“The grid you created in the last challenge will set the number of rows automatically.”

How many rows are automatically created?
And what are their sizes?

Thank you very much!

In the last challenge (, a number of columns was specified. Two columns. So the DOM looks at how many first-level children there are within the top-level grid container, and it places them in columns. Given that there are two columns, the DOM simply places them left-right-left-right-left-right, dealing them one below the other.

It doesn’t mean that you’re given a number of X rows, simply that the DOM doesn’t need to be told how many rows if it’s been told how many columns.

Hi Snowmonkey,
thank you for your answer! :grinning:
Is it the same for rows?

Exactly. Yes. If you define the grid rows, and the layout is row-wise, then it will distribute in rows instead of columns, and you’ll get what you get. I think. Now I’m gonna have to play.

Thank you Snowmonkey!!!:smiley:

1 Like

Delighted to help. I did it for the lulz :smile: