Jump to content

What is the best pratice for multiple style sheets?


stevengreen22

Recommended Posts

Hi all,

 

So, opinions and thoughts on whether style sheets shoudl be seperate or contained in one file?  I know for larger sites there can be several different css files and this makes its easier but it is neccesary for smaller sites to have nav.css and typeography.css and stucture.css etc?  Is this the preferred way or does it just come down to scale and preference?

 

Thanks.

Link to comment
Share on other sites

It comes down to how many header request you find acceptable. The more request you make on your site the slower it will load. That said. The only reason why i would use extra separate stylesheet is when using conditional comments for older versions of IE. Than it is not an option to combine them, unless you want to use all kinds of css hacks which I never use.

Link to comment
Share on other sites

So, you'd just have the one sheet and comment the appropriate sections to make navigation easier?

no I don't comment for production, I have a specific order I always use. In production i use a compressed stylesheet without comments at all. I test locally with a non compressed and commented stylesheet though.

Conditional comments are something different btw

 

 

Link to comment
Share on other sites

I see, for the time being I think I'll use comments until I know what I'm doing.  I understnad the compression to enable it to be read quicker.

 

When you say conditional, I think 'if, else, or, then' etc - I'll take a stab at it being browser specific?  If IE then do this?

 

Time to google.

Link to comment
Share on other sites

yup - quite impressed I got it right :)  But this is only geared towards IE.  Does that mean that the -webkit / -moz are not conditional although they do the same thing? 

 

but...they're quite generic in taht they don't specify versions and the browsers are generally better equipped than IE.  But (to drag this on)  would you really write statements for IE 5?!? 

 

...it's slightly shocking to think that IE would be allowed to be weak in areas that it's competition are not?!?

Link to comment
Share on other sites

Does that mean that the -webkit / -moz are not conditional although they do the same thing? 

 

Well in a way they are.

...it's slightly shocking to think that IE would be allowed to be weak in areas that it's competition are not?!?

it's not shocking at all, each browser has it's own things and if you want you can make your own. The good thing is if you would develop for firefox (properly) the only thing you have to tweak is for ie 6 7 and sometimes 8 so in that sense, it doesn't matter that it is only supported by IE.

 

P.s. if your topics are solved mark them, saves others time reading through. ;)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.