How to apply styles to cells of the first row with CSS?

Spread the love

To apply styles to cells of the first row with CSS, we use the first-child selector.

For instance, we write

.category_table tr:first-child td {
  vertical-align: top;
}

to set the cells of the first table row of the tables with class category_table to have text aligned to the top with vertical-align: top;.

Leave a Reply

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