How to select an element that has a certain class with CSS?

Spread the love

To select an element that has a certain class with CSS, we use a period.

For instance, we write

.myClass {
  color: green;
}

to select the elements with class myClass with .myClass.

Leave a Reply

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