From the course: CSS: Refactoring Style Sheets

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Remove old and/or bad practices

Remove old and/or bad practices - CSS Tutorial

From the course: CSS: Refactoring Style Sheets

Start my 1-month free trial

Remove old and/or bad practices

- [Instructor] Digging into the errors left after stylelint and prettier have done their jobs, I see several are related to the cascade and specificity. If we look at this example, you can see this class doctor h3 is marked and it says, expected selector class doctor h3 to come before selector ID services h3. No descending-specificity. So what styleint is drawing my attention to is that higher up in the style sheet, there is an h3 declaration that has an ID selector on it, which has higher weight than a class selector, and it thinks there's a possibility that this services h3 might actually be overwriting the doctor h3 because services is an ID and doctor is a class. Now whether this is actually the case is easy to figure out. What we need to do is go to the index.html file, and find wherever that doctor class is applying, it's right here inside this container that has the heading ourstaff. That means I can open my site in a browser, and go to the Staff section, which is down here…

Contents