Search code examples
csscss-grid

Remove implicit margin spacing in Grid cell


I am trying to build a Grid layout. In Firefox Inspector it looks like this:

Cell with what seems like margins

Around Drivers there seems to be some margin. When I look into the element however, it has neither padding nor margin. So am I wondering where can find/see which "spacing" it is using for a Grid cell and how can I minimize the spacing?


Solution

  • It will depend on how you have defined the grid. Check your grid gaps, you justify.

    Try this:

    justify-content: start;
    

    It will align to the beginning of each row, assuming direction horizontal. If it removes the gap then you can take it from there experimenting on how you want things to align.

    Edit* Check your grid-template-columns also, it might be the size of your column.