The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS grid behavior – columns vs. rows Reply To: grid behavior – columns vs. rows


Hi, PaulieD
If you mean the row height within the grid-template-rows line, like repeat(3, 10px) that is the point I am getting at. For grid-template-columns I did not have to give a specific width, pixel or otherwise, because I had used 1fr to get an evenly divided fraction of the available space. So I am wondering why it’s treated differently for vertical space (rows).

I tested giving the parent div .grid-vertical a height, like 300px, but it did not seem to do anything. (I guess I really need to go back to square-one with the tutorials and such to try to figure this all out. But I do think my original question is still valid.)

For what it’s worth, I’m not concerned about subsequent implicit rows because I will always know exactly how many rows and columns I will need. I realize I could probably do the math in JS to figure out how many cols/rows can fit the window, but in this case I’m trying to let CSS do the work if possible.