This is a question on usage, rather than difficulty with implementation. A theory question for those smarter than me.
I’m having difficulty understanding the purpose of grid areas beyond an alternative method of creating a grid.
W3C explains grid areas without the use of grid-template-columns
or grid-template-rows
suggesting it as an alternative method of creating a grid. MDN explains grid areas with the use of grid-template-columns
and grid-template-rows
but explicitly states grid ares as an alternative. While freecodecamp does something similar, without explicitly defining grid areas as an alternative way of creating grids. But the curious thing about freecodecamps examples is that their usage of grid-template-columns
and grid-template-rows
is superfluous, that is, in their examples they use both methods to define the same grid so you are unable to see the difference. in fact, you can remove the grid templates from the example and the result remains unchanged.
So my question…
Is grid area simply an alternative method of creating a grid or is there is a purpose to using both grid area and grid templates together?
I’ve included a link to the related example for reference.
Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/css-grid/divide-the-grid-into-an-area-template