Skip to main content

Posts

Showing posts with the label Size

Remove Unused CSS to Reduce the Size of your Stylesheets

The CSS files of your website may have several redundant rules that are no longer used by any element on the web pages. For instance, you may have added a site search box on your website and associated styles went into the stylesheet. Later, if you decide to remove that search box, the styles may continue to exist in your CSS though they aren’t being used anywhere. These unused entries in your CSS files increase the page load time of your website and also affect the site’s performance as the browser has to do extra work parsing all the extra rules. And even if the impact on performance is minimal, it would make your task of maintaining CSS easier if the files are kept clean and well-structured. Opera and the Firefox browser have a popular add-on called Dust Me that scans your current web page and lists all the unused CSS rules that are defined in the stylesheet but not used on the page. Google Chrome users however do not need to install any add-ons as the Developer Tools built inside