CSS bloat

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I just loaded a Transport for London travel update webpage. It seemed slow  
to render so I looked at what the page was made up from. It comprised:

1 HTML file: 55 KB
8 images on page totalling 123 KB.
5 CSS files totalling 545 KB !!!

Moreover, a third of the HTML file's size is due to class="xxxx" attributes  
in every element!  

Unfortunately this is getting increasingly common, with stylesheets often  
having a separate rule for almost every element on each page, which ISTM  
makes a mockery of the whole point of splitting the styling off into a  
common stylesheet file. It would actually make more sense to embed the  
rules in each element using style="xxx", this would at least eliminate the  
overhead of the browser having to look up each class in a stylesheet  
thousands of rules long.

Is CSS bloat the fault of badly written authoring packages, or is it  
clueless users who don't plan their styling rules top-down but simply style  
every item individually so the authoring software ends up making a separate  
rule for each one?

Re: CSS bloat

2014-05-01 4:53, GS wrote:

Quoted text here. Click to load it

This group is for HTML authoring for the WWW. What kind of a page are  
you authoring, and what difficulties or great ideas do you have with  
HTML for it?

Quoted text here. Click to load it

Why would your statistics for some unspecified web page matter, the  
context of HTML authoring for the WWW?

Quoted text here. Click to load it

It sounds like you are trying to ask a CSS question. Before asking it in  
the right group and formulated reasonably, consider whether the question  
makes any sense out of context and whether you are actually looking for  
useful information: what might possibly be a satisfactory answer to you,  
and would it help anyone else?

Yucca, http://www.cs.tut.fi/~jkorpela/

Re: CSS bloat

Quoted text here. Click to load it

This.  Too many authoring tools make no attempt to condense styles,
take advantage of inheritance, or know much about anything other
than div and span elements.

Apple's iWeb was awful for this. It may still be - I don't even know
if they are still making it. I certainly would never use it to author an
html page after seeing all the needless cruft it stuck in every time
you wanted a new paragraph with the same style as the one before...
Want a word or phrase emphasised with italics?  Got to use a span
with appropriate styling!  Ugh.  Unfortunately, a lot of this same
cruft seems to be part of the OS X webkit kernel used at the system level
for copy/paste whenever the system identifies the source as an html

Site Timeline