Unit 2 Lesson 17 Level 6a: id tag vs class tag

What is the difference between these two tags? It seems that you can just use a class tag for each element.

Class tags can be applied to multiple elements on the page, but also just one.
You would use an id tag if you wanted one element to look different.

Also, helpful to know about class tag: A class rule-set can have the same rules as any other type of selector. If a rule does not apply to the content of the class (for example, using font-size on an element with no text), then the computer will ignore that rule, but still use the rules that work.

1 Like