1

I'm working on creating a 12 column css grid framework which mirrors Foundation's grid system and I'd like to create a utility class for centering a column but I can't seem to do it.

My framework works on setting the grid-column property to a span value I.E

.medium-8 {
    grid-column: span 8;
}

On a medium device when applied to a div the above class will make said div span 8 of the 12 columns. What I need to do is to create a .medium-centered class that will then center the div within the 12 column grid. I've researched this pretty well and I feel like

justify-self: center;

Should do the trick but it doesn't affect the div in anyway.

Any help would be much appreciated.

  • https://css-tricks.com/snippets/css/complete-guide-grid/ You probably have what you need in that class, you just need to tell it what track to start on (i.e. 3 ) and it will be centered. – Ben Steward Sep 15 '18 at 13:11

0 Answers0