CSS Grid: Is it possible to apply color to grid gaps?

Taishi picture Taishi · Aug 25, 2017 · Viewed 44.6k times · Source

Is there a way to style more than just the width of the grid gaps within the CSS grid layout module? I can't find anything about it in the documentation, however one would tend to think that it would be possible as grid gaps tend to be colored in many designs. If it is not possible, is there a workaround?

Answer

eriklharper picture eriklharper · Dec 20, 2017

Sadly, there is currently no way in the CSS Grid spec to style grid-gap. I came up with a solution that works well though that involves just html and css: show border grid lines only between elements