Afternoon,
The last company that did some work for me made it so that there's one stylesheet for IE and then another for the rest, is this needed or is it better to just run one for everything?
Afternoon,
The last company that did some work for me made it so that there's one stylesheet for IE and then another for the rest, is this needed or is it better to just run one for everything?
Often, an additional stylesheet for IE will help work around IE's CSS bugs, so a properly configured one is good if you need it. Not every site needs special handling for IE.
This avoids having IE-specific rules active for other, better browsers.
Good question, and I note that gjh42 has already mentioned why IE needs special treatment, but to answer your question "is it needed or is it better to run one for everything?" It is my opinion that separate style sheets are better than "one sheet for everything".
The fact that these are called Cascading Style Sheets (CSS) also suggests that by design there should/could be several of these sheets working together.. Otherwise they'd be called SSS (Single style sheets)
Having said that, there is no 'rule' that states you MUST have more than one SS, or that they MUST cascade, and many people actually prefer to put everything into a single sheet. Also many performance reporting tools will even suggest that multiple CSS files be combined into a single file.
The end result will always be the same (all else being equal), so I suggest you use what you are most comfortable with.
Cheers
Rod
A reason to use a separate IE stylesheet is that some rules needed to make IE behave will cause other browsers to misbehave. You need to serve those rules only to IE, or else do very complicated gymnastics to keep other browsers from seeing them.
Who was it that once said, "The nice thing about standards is that there are so many to choose from"
Anyway, I really don't wish to get into an in-depth discussion about this because it has all been covered a bazzilion times before, and we all have our favourite methods of doing things, so for the most part, what is best comes down to personal opinion.
As for possibly missing something I really can't comment. The following link provides a 'tip' that I only stumbled across a few months ago.
http://briancray.com/2009/04/16/targ...r-in-your-css/
Is this one that you are aware of?
Needless to say, this now comes back to gjh42's original comment about 'complicated gymnastics', and my current response is now 'define complicated'.
To me, adding stuff like
<!--[if IE 6]> <link rel="stylesheet" href="ie6.css" type="text/css" /> <![endif]-->
To the pages, and creating a whole new stylesheet for any given browser (or browser version)
is just as complicated as using any of the well known hacks to achieve the same result.
Anyway, I think between us we have more than adequately answered the OP's question.
Cheers
Rod