Interactive online courses HTML Academy
2026-03-09 14:07 Diff

One interesting feature of grid cells is that you can count their coordinates either from the start (first line of the row or column) or end of the grid (last line of the row or column). Here is how it looks schematically:

In other words, to tell the cell: “Start on the first column line counted from the start and end on the first column line counted from the end“, you need to specify the following code:

.element { grid-column-start: 1; grid-column-end: -1; }

And in order to tell the cell: “Start on the first column line counted from the end of the grid and on the first line counted from the start”, you need to write:

.element { grid-column-start: -1; grid-column-end: 1; }

Let’s see how we can use this device in practice: