0

Is it possible to give background to a full row inside a css grid? Full width background for grid rows

If i give background-color to the child elements of the grid it will looks like this not full size colored boxes

Is there any solution for this expect making every child element "stretch" size and using them as a flexbox to center the content?

tomitheninja
  • 497
  • 2
  • 13

1 Answers1

2

The easiest way to do this would be to have the grid elements stretch to fill the space. If you don't want to do that, you will need to wrap the grid elements in other elements that do stretch if you want to have an adaptive background.

David A
  • 48
  • 6
  • 1
    Actually it's not necessary to *wrap* the elements. Additional elements can be *layered* which cover the same whole row. – Paulie_D Mar 06 '19 at 15:32