Hi,
I was wondering when you add an ID attribute to an HTML element but there is also a CLASS attribute to the same element and you want your CSS selector point to them, which one will be used? CLASS or ID?
In the lesson, it says “If an HTML element needs to be styled uniquely (no matter what classes are applied to the element), we can add an ID to the element.”
So, does it mean that the if in our CSS we refer to the ID of a given element it will always override the CLASS attribute? Can it happen vice versa where the CLASS would override the ID attribute?
Thank you!
Sorry, in the next lesson I got my answer. It says " Since IDs override class and tag styles, they should be used sparingly and only on elements that need to always appear the same."
The lesson in the link provided: