-2

I have seen this as the norm:

enter image description here

It has a class selector with a property and a value, then that class is called below.

That makes sense.

But i have seen this too:

enter image description here

There is an element with a class in the <style> section, what's the difference and why is there a need to put the element with the class as the selector instead of just the class?

Flonne
  • 91
  • 8

1 Answers1

1

.co will select all elements with that class. div.co will only select div elements with that class. It's more specific.

xdumaine
  • 10,096
  • 6
  • 62
  • 103