# Understanding CSS selectors

**URL:** <https://forum.codewithmosh.com/t/understanding-css-selectors/26301>\
**Category:** HTML/CSS\
**Created:** [April 26, 2024, 10:07pm UTC](https://forum.codewithmosh.com/t/understanding-css-selectors/26301 "2024-04-26T22:07:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![techytony](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@techytony](https://forum.codewithmosh.com/u/techytony)\
**Post date:** [April 26, 2024, 10:07pm UTC](https://forum.codewithmosh.com/t/understanding-css-selectors/26301/1 "2024-04-26T22:07:34Z")

</div>

I need some clarification on something, I taught my self the basics of CSS, BEFORE I started learing HTML…I know now it should have been the other way around…

Mosh is talking about all the different types of CSS selectors, when i learned the basics of CSS I was finding the class but using chrome dev tools but ONLY looking for the classes. and somes times those classes did not work, perhaps this is why…

Based on what I am leraning here, if i cam looking for CSS class to style something, it could very well be an iD or soe type of other selector.

Is this right, am I understanding this?

---

<div class="post-metadata">

**Author:** ![URMine4Ever](https://avatars.discourse-cdn.com/v4/letter/u/a87d85/32.png) [@URMine4Ever](https://forum.codewithmosh.com/u/URMine4Ever)\
**Post date:** [April 27, 2024, 4:51pm UTC](https://forum.codewithmosh.com/t/understanding-css-selectors/26301/2 "2024-04-27T16:51:16Z")

</div>

I think if I am understand correctly some CSS selector doesn’t seem to be working. I think it might just be css specificity. (element tag, class, id). If you have an element that have both class and id and they both are trying to change for example the color, it would have the color of the id since it is more specific.
