Forum Moderators: not2easy

Message Too Old, No Replies

Any Site Optimization Experts out there?

Need to figure out which method is better - external sheet vs many classes

         

jdoggz316

3:36 pm on Sep 22, 2005 (gmt 0)

10+ Year Member



I'm currently working with a content management system, and therefore have many pieces of reusable content. Obviously CSS is the ideal way to seperate the content from design. These reusable pieces of content should look different from time to time as per design specifications. My question is this:

Either I can have multiple classes in my CSS file - and assign those classes to each particular "list" or piece of content so i can get it to look the way i want...

-or-
I can have each piece of content always use the same class as defined in an external style sheet - and redefine that class as necessary with extra stylesheets depending on the look that particular piece of content should receive.

I guess the question can be boiled down to - Whats worse (with regard to rendering and site performance) : 1 long external CSS file, or Several Smaller External CSS files?

Thanks!

moltar

3:52 pm on Sep 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I guess it all depends how often will reusable pieces of content look different. I.e. define "time to time".

If only 10-20 pages will be different, I'd put it all in one CSS file with several classes.

If we are talking about 100s of variations, I'd consider embeding CSS directly into

<head>
or even inline (if properties differ slightly, e.g. different color or font face).

jdoggz316

12:06 am on Sep 23, 2005 (gmt 0)

10+ Year Member



We're talking about tens of thousands of instances of many different lists. About up to 10 variations of looks. I like your idea of embedding in the head, but i'd like to know if that causes load time to increase because that style information would be specific to each page, and wont be cached across multiple page requests?