Multiple CSS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    Multiple CSS

    I have been looking through the tonnes of pages/forums about using multiple CSS's and I was wondering if all CSS's are cached if you have more than one?

    I have read both sides of the debate on whether or not to use multiple CSS files, and I have been using one for a long time now, but it is getting very big and difficult to edit (as it's still in dev) so I am going to try have more than one. Anyway, once it's finished I might put it all back into one, but at the moment the readability advantages look more valuable than the tiny increase in efficiency? Any personal thoughts appreciated.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by TheServant
    I have been looking through the tonnes of pages/forums about using multiple CSS's and I was wondering if all CSS's are cached if you have more than one?

    I have read both sides of the debate on whether or not to use multiple CSS files, and I have been using one for a long time now, but it is getting very big and difficult to edit (as it's still in dev) so I am going to try have more than one. Anyway, once it's finished I might put it all back into one, but at the moment the readability advantages look more valuable than the tiny increase in efficiency? Any personal thoughts appreciated.
    This is not a definite answer, but it would seem silly to me that a browser wouldn't cache more than 1 external css file. Lot's of big websites use multiple css files. I wouldn't worry about it.

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      The only disadvantage of multiple files is multiple http requests. Whether that slows things down for the site depends on the internet connection and the server.

      Comment

      • tharden3
        Contributor
        • Jul 2008
        • 916

        #4
        Sorry for my ignorance (but I value learning), what do you mean by multiple CSS files? Do you mean multiple files for multiple HTML pages? Or in your case using one CSS file for multiple HTML pages? Would one CSS file reduce load times for a site? Just curious.

        Thanks,
        Tim

        Comment

        • David Laakso
          Recognized Expert Contributor
          • Aug 2008
          • 397

          #5
          ...what do you mean by multiple CSS files?
          Short Answer:
          Taking one extremely long style sheet and dividing into individual (5 in this example) style sheets:
          layout.css
          typog.css
          color.css
          links.css
          misc.css

          Comment

          • tharden3
            Contributor
            • Jul 2008
            • 916

            #6
            Originally posted by David Laakso
            Short Answer:
            Taking one extremely long style sheet and dividing into individual (5 in this example) style sheets:
            layout.css
            typog.css
            color.css
            links.css
            misc.css
            oh, I see. Thanks. That's kind of interesting, I never thought of doing it like that. My CSS pages are getting longer and longer with this new website I'm designing, so I could understand how separating them could be more efficient.

            Comment

            • David Laakso
              Recognized Expert Contributor
              • Aug 2008
              • 397

              #7
              I could understand how separating them could be more efficient.
              It could also wind up being an inefficient ball of confusion. Different strokes for different folks. The method that is best for you will find you...

              Comment

              • TheServant
                Recognized Expert Top Contributor
                • Feb 2008
                • 1168

                #8
                Thanks for all your replies, I will give it a go, but as David said, it is actually possible to be even more confusing which I quickly realized.

                Regards,
                TheServant

                Comment

                • drhowarddrfine
                  Recognized Expert Expert
                  • Sep 2006
                  • 7434

                  #9
                  Originally posted by TheServant
                  it is actually possible to be even more confusing which I quickly realized.
                  It can be at first but it's a mindset and depends on how you write the html. The first time I did it, it wound up being a big mess. The second time made perfect sense.

                  Comment

                  Working...