CSS Quiz query - .crypto-prices.crypto-prices

Hi guys,

I've just done the CSS Quiz but am confused as to why for Question 1 (below), it is saying the correct answer is .crypto-prices.crypto-prices ?

Which of the following selectors has the highest priority among the ones that select the <section class=”crypto-prices”>…</section> node?

  • section
  • .crypto-prices
  • #crypto-prices
  • .crypto-prices.crypto-prices

I worked it out using the W3 Schools calculator here and on that basis, the ID #crypto-prices would come out on top. What am I missing?

Thanks all!

1 Like

Yes, you right the ID has the highest priority. But the question is for the given section node <section class=”crypto-prices”>…</section> And we only specify class so class selector will have higher priority than section selector. Hope it make sense.

Thank you for coming back to me!

So if I have understood correctly, I was basically getting ahead of myself as setting ID selectors hasn't really been looked at yet? And that for there to be an ID selector, the node would need to read something like this?

<section class=”crypto-prices” id="crypto-prices">…</section>

Is that correct?

Exactly in that case the ID selector has the highest priority.

Hi Maki,

thanks for the explanation. But I don`t get it why .crypto-prices.crypto-prices is the correct answer and not .crypto-prices.

Would be great if you could explain this too :slight_smile:

Thanks in advance!

1 Like

The correct answer is .crypto-prices, the correct answer on the quiz was incorrect, I have fixed it.

Including this other comment.

Thank you for notifying us :nerd_face:

Carlos Z

1 Like

Thanks for the quick reply Carlos :slightly_smiling_face: :+1: