SitePoint Sponsor |
|
User Tag List
Results 1 to 9 of 9
Thread: size of css file
-
Dec 31, 2006, 11:35 #1
size of css file
hello good pple of the forum,
I am currently creating a website and i am a bit worried with the size of my css file it is about 23kb. Please what downsize does this have in the download time of the site eventually what is up.
Cheers.
HAPPY NEW YEAR MY FORUM PEOPLES
-
Dec 31, 2006, 12:42 #2
- Join Date
- Jan 2003
- Location
- Hampshire UK
- Posts
- 40,556
- Mentioned
- 183 Post(s)
- Tagged
- 6 Thread(s)
Hi,
23k is getting a bit large but it does depend on whether all the css is required for all pages or whether your site can de divided into sections.
If you have separate sections on a large site then the css can be subdivided. If however its a small site then you may as well take the hit in one go.
Make sure though that you have optimised the code as much as possible as you can save a lot of code by using shorthand etc.
There are a lot of tips here:
http://www.stopdesign.com/log/2005/0...tip-flags.html
http://www.mezzoblue.com/archives/20.../css_optimiza/
-
Jan 3, 2007, 15:03 #3
- Join Date
- Nov 2006
- Location
- DK
- Posts
- 59
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
In a thread a few days ago someone mentioned this: http://www.cleancss.com/
I haven't used it myself, but tried with the largest css file I had and it was reduced about 10%. But notice, I didn't test the generated file!
-
Jan 4, 2007, 06:56 #4
- Join Date
- Nov 2004
- Location
- belgium
- Posts
- 465
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
i tried this clean css service and it reduced by file by 30%, using a shorthand notation i didnt know yet (using 3 values for padding instead of 4 or 2 values). nice!
I need someone to protect me from
all the measures they take in order to protect me
-
Jan 4, 2007, 10:51 #5
- Join Date
- Nov 2006
- Location
- DK
- Posts
- 59
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Do you mean #FFF instead of #FFFFFF?
This is all the same:
color:blue;
color:rgb(0,0,255);
color:rgb(0%,0%,100%);
color:#0000FF;
color:#00F;
(Taken from "HTML Utopia: Designing Without Tables Using CSS", page 161. I really recomment this book to CSS newbies!)
-
Jan 4, 2007, 11:22 #6
- Join Date
- Jun 2002
- Location
- Planet Vorcon-5 in sector cx-37-b
- Posts
- 1,136
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
cleancss.com was a good find, thanks for that.
I passed Revs.org css through it, found a couple of errors, made it more manageable because the order of code is more regular, and reduced my file size from 8862 bytes to 8211 byteswork: revs | ecru
reviews: films | mp3s
projects: Glastonbury Tor | London IT support
-
Jan 5, 2007, 10:16 #7
I actually stumbled over sitepoint's shorthand css tutorial and i was able to reduce the file size to about 16kb. Cleancss is sure good but it removes the backslash off the ie5 hacks.
Thanks guys.
Nice one hugeland and happy new year everybody in the css forum.
-
Jan 5, 2007, 10:22 #8
- Join Date
- Dec 2006
- Posts
- 26
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
given that a css file is usually cached on the client and most people have highspeed internet, 23Kb is not a big issue. However it is good practice to keep your html and css coding as clean as possible to improve maintainability and eliminate hard to find bugs.
Robust, Scalable, Custom Ecommerce Solution
-
Jan 5, 2007, 11:18 #9
- Join Date
- Jun 2002
- Location
- Planet Vorcon-5 in sector cx-37-b
- Posts
- 1,136
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I might be suffering from wishful thinking but it seems like the improvement in rendering time for my website is better than the file size reduction would suggest.
work: revs | ecru
reviews: films | mp3s
projects: Glastonbury Tor | London IT support
Bookmarks