@NatureSon22
Posted
I noticed you used IDs for styling which is generally not recommended because IDs have the highest specificity in CSS. This makes it difficult to override styles and can lead to issues. Instead, it's better to use classes for styling as classes are more flexible and easier to override. For more information, you can look up CSS specificity.
@mihainrs
Posted
Hey @NatureSon22 !
Thanks for pointing it out! I've used to work with classes mostly in my past projects, but now having to deal with JS as well, I found it easier to just go for ID's for certain elements as long as they don't recur in my HTML, and at the same time I thought I could get more used to it given how I barely used them before.
I'll definitely look into specificity and see how it all works, thank you for the pointers!