Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / 2 Stylesheets, is this needed?

2 Stylesheets, is this needed?

Locked

Views: 796

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
24 Oct 2011, 12:19 PM
#1
dpm avatar

dpm

Zen Follower

Join Date:
Mar 2008
Posts:
262
Plugin Contributions:
0

2 Stylesheets, is this needed?

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?

24 Oct 2011, 12:37 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: 2 Stylesheets, is this needed?

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.

24 Oct 2011, 1:07 PM
#3
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: 2 Stylesheets, is this needed?

DPM:

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?

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) :wink2:

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

24 Oct 2011, 1:12 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: 2 Stylesheets, is this needed?

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.

24 Oct 2011, 1:15 PM
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: 2 Stylesheets, is this needed?

gjh42:

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.

If you find this to be the case then you probably need to review your knowledge of CSS.

Cheers
Rod

24 Oct 2011, 2:29 PM
#6
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: 2 Stylesheets, is this needed?

RodG:

If you find this to be the case then you probably need to review your knowledge of CSS.

I'll respectfully disagree with that. Many current CSS standards don't work in IE6 or 7, and an additional IE stylesheet seems to be the simplest way to fix that, unless I'm missing something.

24 Oct 2011, 5:32 PM
#7
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: 2 Stylesheets, is this needed?

stevesh:

I'll respectfully disagree with that. Many current CSS standards don't work in IE6 or 7, and an additional IE stylesheet seems to be the simplest way to fix that, unless I'm missing something.

Honestly, with only 3% to 4% of people still using IE6/IE7 I'm not sure it's worth spending much time worrying about.

24 Oct 2011, 6:10 PM
#8
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: 2 Stylesheets, is this needed?

It depends a little on who you're selling to. A surprising number of businesses have proprietary internal sofware that will only run in IE6, so a B2B site should probably work properly in that sorry excuse for a browser.

The IE7 people are a mystery to me, unless they're running illegal copies of Windows and can't upgrade.

24 Oct 2011, 6:14 PM
#9
rescoccc avatar

rescoccc

Totally Zenned

Join Date:
May 2010
Location:
WA State
Posts:
1,700
Plugin Contributions:
2

Re: 2 Stylesheets, is this needed?

A surprising number of businesses have proprietary internal sofware that will only run in IE6, so a B2B site should probably work properly in that sorry excuse for a browser.

Good point. I have a client who is actually still using Windows 98 for their production systems because the software they use is big bucks to upgrade.

25 Oct 2011, 2:04 AM
#10
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: 2 Stylesheets, is this needed?

stevesh:

I'll respectfully disagree with that. Many current CSS standards don't work in IE6 or 7, and an additional IE stylesheet seems to be the simplest way to fix that, unless I'm missing something.

Who was it that once said, "The nice thing about standards is that there are so many to choose from" :smile:

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/target-ie6-and-ie7-with-only-1-extra-character-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

25 Oct 2011, 2:31 AM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: 2 Stylesheets, is this needed?

I would agree in most cases about not taking extreme measures to support IE6 & 7, as long as visitors can still use the site. Fortunately, newer IE versions handle basic CSS much better. I like that tip on property prefixes - it's so simple and (if it works reliably) so useful that I wonder why word of it didn't spread more. Maybe because it does not validate and standardistas value that more than efficiency...? Of course, it still doesn't help old IE cope with selector bugs.

25 Oct 2011, 2:36 AM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: 2 Stylesheets, is this needed?

The IE7 people are a mystery to me, unless they're running illegal copies of Windows and can't upgrade.I understand this is a common case in large parts of the world...