4 ms·
Sometimes I want more control than gap can provide, especially in grid. Suppose I want different gaps between different columns in a CSS grid - how would I acco
by klysm 3y ago
Sometimes I want more control than gap can provide, especially in grid. Suppose I want different gaps between different columns in a CSS grid - how would I accomplish that?
- mock-possum 3y agoWhat’s stopping you from defining the gaps as individual entries in your template? First column ‘fr’ gap ‘15px’ second column ‘fr’ gap ‘30px’ third column ‘fr’ and now you have three equal columns with two different gaps?
- muspimerol 3y agoThe downside with this approach is that I often want the element itself to define how much space is around it. When you conditionally include elements in a layout, I find margin more expressive and less cumbersome than changing the grid-template-column property of the parent.
- deleted 3y ago[deleted]
- nailer 3y ago> Suppose I want different gaps between different columns in a CSS grid - how would I accomplish that? Good question. That sounds like you have different groups. eg: you're thinking of it as: .items .item1 (thin gap) .item2 (thick gap) .item3 But it's actually: .items .sale (thin gap) .item1 .item2 .regular (thick gap) .item3