Closed bastianalbers closed 10 years ago
Showing how things are not done is usually not the best way. How about just explaining that writing selectors next to is other is creating hierarchy? Have lots of people tried to do the nesting?
Yes, maybe confusing. I just felt something had to be said there but maybe it is a little too much and confusing. I don't really remember, but specifity is something everyone needs pretty quick. But maybe it is something we could teach people who are quick in the end. You should still merge the fixed typos though.
How about just removing the not working examples? Otherwise I think it's helpful. Just "this is how you do it" minus the "this is how you not do it".
Ok, changed it up a little to show that a more specific rule beats a less specific one and left out the negative example
I added a short note on hierarchy in the styles section, as we show nesting elements in HTML and i want to make sure people don't wonder why nesting doesn't work in CSS. Also later on we show how to style an ul with nested li elements so i thought a short notice how you can do more specific rules was appropriate there.