I have managed to manually place items on a grid using CMS values and simple custom code but I have to resort to using a hack or a trick to make it work. I would love to not have to use that hack.
Basically, I don’t understand why I have to add a + 1 column end and a + 1 row end to the value of the CMS. The values of the CMS are exactly the one from the “static grid”, so it should work also for the “dynamic grid”, except it doesn’t.
The reason it makes sense is we think of columns and rows as the places where you put things. But the CSS spec approaches it differently, it counts position in terms of the column and row lines.
So when you tell CSS grid-column-start: 2 and grid-column-end: 4, you’re telling it to draw the item between Lines 2 and 4. From your perspective ( and the Webflow designer’s representation ), that’s columns 2 & 3.
Why would the W3C do this? Well, we can only guess. One possibility is that maybe they want to leave open the possibility of fractional alignments, e.g. grid-column-start: 1.8 or mixed-unit implicit calcs like grid-column-end: 4 + 20px.
I don’t know this, but I like the thinking, would make for some creative overlapping bento layouts.
Wow, okay very interesting !
Thank you for having taken the time for the deep dive.
The illustration you shared helped me understand the issue, appreciate it !
Well I’ll stick to the calc + 1
IMHO it is quite opposite. You expect to position area as you have set 2/2/3/4. When I will set row to start at horizontal line 2 and end on horizontal line 4 (means: occupy two rows) AND to col start at vertical line 2 and end on vertical line 3 _(means: occupy one col)_I will expect to be positioned correctly.
I do not even mention they have set inputs their own way to group these values together. I understand that as it makes more sense for non devs who are not familiar with CSS.
CSS it set as standard geometrical principle thing about it as area is FROM <top-left> TO <bottom-right>