SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Addict ghostme's Avatar
    Join Date
    Feb 2005
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,343
    Mentioned
    179 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/

  3. #3
    SitePoint Enthusiast
    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!

  4. #4
    SitePoint Evangelist stef25's Avatar
    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

  5. #5
    SitePoint Enthusiast
    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!)

  6. #6
    Matt Williams revsorg's Avatar
    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 bytes
    work: revs | ecru
    reviews: films | mp3s
    projects: Glastonbury Tor | London IT support

  7. #7
    SitePoint Addict ghostme's Avatar
    Join Date
    Feb 2005
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  8. #8
    SitePoint Enthusiast
    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

  9. #9
    Matt Williams revsorg's Avatar
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •