Can additional, unused CSS definitions slow down browsers?

After working with many CMS and shortening many HTML projects, when I saw SilverStripe using CSS , I was converted.

Essentially, it would be a mistake to change the identifiers in the tags <div>depending on the page you were on, and that changing the tag classes <body>and identifier would be an easier way to change certain pages.

Such beliefs were challenged by a colleague during the following problem:

On a particular website, we have several pages that are similar in structure. Some may include a special form, and some may not. All special shapes should have a different background image, depending on which section we are in.

Due to the claim that “extra CSS lines slow down body.onLoads”, my argument for coding all background expectations in CSS was rejected.

Can someone provide evidence between the various cases? Cases, including: poorly encoded CSS and CSS well encoded, but having lots of unused CSS on every page?

(And, in particular, on my problem, can someone explain my awkwardness? I feel uncomfortable assuming that the images will be there and automatically generated by Inline CSS (or style tags based on the header) based on the variable from the database. )
+5
source share
1 answer

It will not matter (noticeably) if your website is not Gmail or YouTube (or CSS is too heavy).

Google has recommendations in the page speed guide:

http://code.google.com/speed/page-speed/docs/payload.html#RemoveUnusedCSS

Removing or canceling style rules that are not used by the document avoids loading unnecessary bytes and allows the browser to start rendering earlier.

-, , . , , , . , , CSS , , , . CSS , , , .

, CSS; - CSS, .

:

, " CSS body.onLoads," CSS .

. , , "".

+7

All Articles