Forum Moderators: not2easy

Message Too Old, No Replies

When is it too much of a good thing?

CSS file sizes

         

Cienwen

8:04 pm on Feb 15, 2007 (gmt 0)

10+ Year Member



I was just looking for some opinions from those who use CSS regularly. When is a CSS file too big? How many k? All opinions and speculation are welcome!

scriptmasterdel

12:49 pm on Feb 18, 2007 (gmt 0)

10+ Year Member



Alot of people i work with think that anything greater than 8-10k is just too large, they are right - if a css file is written well then it's pretty easy to keep it under 8k.

I don't really put much effort into compacting my css files, alot of them are well formatted and i have a lot of comments to make things easier for people who may change the file later. If i thought it was an issue i would do something about it.

Nice thread, it's definitely something to think about.

Thank you,

Del

Robin_reala

1:11 pm on Feb 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I dunno. Our sites are large and pretty complex layout wise and our base CSS files (added together) stack up at around 35kb. They’re pretty well optimised as well (although of course there’s always room for improvement). It’s not ideal, but it’s not always possible to code a site in 8-10kb.

penders

2:10 pm on Feb 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I would agree that 8-10KB for your CSS is difficult to maintain, particulary if you have completely separated your content and layout - in which case your content (HTML) files should be smaller. So it's really a combination of the two (and three and four with JS and images) that ultimately matter.

Also remember though, that a site-wide CSS file caches pretty nicely, so the overhead for subsequent pages is less.

Personally, I think I'd be happy with a 15-20KB CSS file. That's about 1000+ lines with comments and CR's - so could be optimised.

ronin

3:28 pm on Feb 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I try and keep my CSS under 1kb but I constantly fail. I'm still working on it though. I will get there. >;->

Acreo Aeneas

10:39 am on Feb 20, 2007 (gmt 0)

10+ Year Member



It depends on the target audiences that the website is written for. If that target audience is gamers or web professionals, then size doesn't really matter since they have decent to very good broadband.

If the target audience includes 56k users, then I might worry about a large collection of CSS files. For the most part it's not a issue for me. Most of my files are under 20kb.

Cienwen

12:26 am on Feb 21, 2007 (gmt 0)

10+ Year Member



A big “thank you” to everyone who responded. I was very interested in what was considered to be an average.

I really liked the idea that everything would be controlled by one universal style sheet, but as I took into account variations in layout, etc., I noticed my file was getting bigger and bigger. Thanks to all your comments, I think I jumped the gun! My file is only 4k.

I think I’ll add some more ;)

Cienwen