Transcript from the "Problems with CSS" Lesson
>> So an ID selector is much more specific than just selecting all h1 tags. And so whatever has the ID select or whatever styles are in that are gonna be applied. But this is problematic for several reasons. The first is our styles are slowly becoming decentralized, because we have three different ways that we can write CSS.
[00:00:21] This can be really hard to remove code, if you rip out some features of your product, or if you update them. It can be hard to update your CSS if you don´t know where to find it. And a lack of knowledge about specificity leads to a lot of importants going on.
[00:00:38] So if we look at this code example, we can see this is selecting every single list item, and it's setting its color to blue. And then here, we've got a different way that we could also be setting the color to blue. So we have here, we're selecting an unordered list with a class of shopping-cart, and selecting all immediate children list items.
[00:01:00] So it's not gonna do nested list items, just the top level immediate children, set their color to blue. Or you could just select all list items with a color of shopping-cart-item and set their color blue with an important, so that's gonna override everything. Or you could select your shopping-cart and then do all children descendants.
[00:01:16] The point being, there's a lot of ways that you can write CSS.