Removing unused selectors


show more Removing unused selectors provides you with in-depth training on Web. Taught by Justin Seeley as part of the CSS: Visual Optimization show less
please wait ...

Removing unused selectors

Another great way to make sure that your CSS is as clean and as tidy and as fast as it needs to be is to remove something called unused selectors. And so, if you've developed a pretty long CSS document, it might actually be a little difficult to find an unused selector, and exactly what is an unused selector? Well, it's something like this right here on line 70, where I have this class called button and then after that there's really nothing to find. Either this means that I defined it somewhere else, I put it in a selector group, or it's just something that never really fully got developed and didn't make it into the final shipping version of the website.

Same thing holds true down here for the content h2. Maybe I've fixed that somewhere else, the aside h3, same thing. And so there's going to be all of these different empty selectors throughout your documents that you need to find and get rid of. Why do you need to get rid of them? Because that's one less line of C...

Removing unused selectors
Video duration: 1m 52s 1h 11m Beginner

Viewers:

Removing unused selectors provides you with in-depth training on Web. Taught by Justin Seeley as part of the CSS: Visual Optimization

Subject:
Web
Software:
CSS
Author:
please wait ...