Why is id selector using div and intro resulting to gray backgroundcolor? While class selector used class="first" ?

I'm confused

11th Nov 2021, 6:37 PM
Bala Didi Nwaozor
Bala Didi Nwaozor - avatar
2 Answers
Can you please link your code? Without seeing the code, we don't know which ids and classes there are
11th Nov 2021, 7:00 PM
Lisa - avatar
Answering based on assumption: In CSS, id takes higher precedence than class. Properties written in class for a element is always overwritten by the properties written in a id for the same element. Use !important to give class higher precedence.
11th Nov 2021, 10:47 PM
Zubae - avatar