rachelandrew / cssgrid-ama

Ask me anything about CSS Grid Layout
328 stars 12 forks source link

span to end without specifying current line #101

Open Ponant opened 7 years ago

Ponant commented 7 years ago

I have an item which is placed on cell 2 of a 4 column grid and I can make it span to the end of the grid by grid-column: 2 / -1; or grid-column: span 3;

However, the first instruction requires the initial column line "2", and the second one also "3"=4+1-"2"

I would like to be able to span to the end without specifying the initial column line. Said differently, if we can dospan 3 or span 4, etc, why not a span -1 that would span from the current position to the end? grid-column: span -1;

Ponant commented 7 years ago

https://codepen.io/anon/pen/eERwBp

keithjgrant commented 7 years ago

You can do it by only specifying the grid-column-end:

grid-column-end: -1;

or

grid-column: auto / -1;