How to target a specific column or row in CSS Grid Layout?

Spread the love

To target a specific column or row in CSS Grid Layout, we use grid-row.

For instance, we write

div[style*="display:grid"]:grid-row(3) {
  background-color: blue;
}

div[style*="display:grid"]:grid-column(3) {
  background-color: green;
}

to select grid row 3 with :grid-row(3) and we select grid columnd 3 with :grid-column(3).

Leave a Reply

Your email address will not be published. Required fields are marked *