Ok, I have an issue where a client is using IE6 (god forbid that they should upgrade), and all my css is whacked for the most part and doesn't work. Everything works fine in IE7, FF2 and Safari. Isn't there a way to make two style sheets and then when the page loads you tell the browser to load the IE6 style sheet or IE7 style sheet? What is the correct syntax for that?
I REALLY advise against wasting time on a second stylesheet - do you have a link or URL to the code? USUALLY if you have a VALID doctype there are only two things that rear their ugly head: haslayout which is easily fixed, and the lack of min-height which can be coded around. I honestly feel that if you cannot get a single stylesheet to work in IE 6, 7, FF, Opera and Saffy, you probably are using the wrong HTML, the wrong CSS, or both. ESPECIALLY since once a new browser version comes along you'll end up diving to create yet another stylesheet - see the mad scramble IE7 created, and that FF 2.0 created to a lesser extent.
The mad scramble in IE 7 was created by using the Holly hack, which IE 7 properly doesn't recognize. You'll be better off avoiding hacks altogether.
Sorry, but bullshit - YES it doesn't support it - because it isn't NEEDED. A PROPER holly hack can be sent to all browers, including IE7 without issue since height:1% defualts to height:auto if the container around it does not have a height declared. I cannot think of a situation where the Holly hack would break IE7, unless you also didn't work in FF, Opera and Saffy as well. The mad scramble was created by people creating one stylesheet per browser since new browser means new stylesheet - or by people IMPROPERLY using hacks because they dove for the hack BEFORE trying other techniques or because they didn't want to throw out their buggy broken code and instead were looking for some crap silver bullet fix. I've been seeing a LOT of statements like that about IE7 which seem to have NO BASIS IN REALITY. But then, I break hacks into two categories - workarounds and actual hacks. Workarounds are things you can send safely to all browsers that corrects the behavior of one. Display:inline on a float to kill double margins for example is a workaround and safe (thanks to the wording of the specification no future browser should EVER throw an error doing that), height:1% on a container that's parent element doesn't have a height declared - by the specification that's future proof moving forward because height:1% of unspecified get's changed to height:auto... Which is why you can usually inline those with little or no worry. (and why every time I see someone hiding that inside a star hack I go "What the ****") Real hacks to me are things you have to hide from being sent to other browsers - those are almost always a /fail/, though the * html seems to be the least painful/problematic of them... I know in my code I've not ONCE ever had it be an issue.... Though the only time I really use that is either to tweak a form element, or to specify height instead of min-height. (which occasionally includes switching overflow:hidden to overflow:visible as well) Bottom line - instead of wasting time writing the page more than once (which is what multiple stylesheets really is) use clean semantic markup, minimalist CSS and write the page to work properly cross browser in the first place - it is NOT that hard to do - MOST of the time if you have layout issues cross browser either the coder is overthinking their layout, floating the wrong direction/improperly, or missing one or two minor fixes which total one or two lines of code - hardly worthy of wasting an extra handshake and three to six lines of HTML on. Though often you have to throw it all out and start over to reach that point becaues the techniques being used are wrong from the start either from coder error, or overreliance on some crap WYSIWYG like Dreamweaver or Frontpage. The old New England phrase "Ya cahn't get theyah frum heeyah" comes to mind.
In the ecommerce field making money is the whole game. I would never recommend re-coding and entire website when 15 minutes work with a second stylesheet would fix everything forever.
Problem is it rarely does 'fix everything forever' - and allowing bloat, errors and problems just means they are going to have to revisit the code every few months COSTING maintennance, COSTING manpower, COSTING bandwidth, COSTING future compatability and possibly even COSTING uptime. You are quite correct - the bottom line is making money - but spending an extra 30-50% on your hosting costs cuts into your profit margins. Buggy bloated code that breaks every three months and is a pain in the ass to maintain requiring even MORE labor when something does break or time comes to make more changes. YES we are talking extra effort - but that extra effort nets dividends in the long term - THAT'S WHAT BUSINESS IS ABOUT. Investment and return. Especially when the types of changes I'm usually talking about can take a page that's choking out a 100mbps connect on a eight blade server and run it BETTER on a simple 3ghz P4 with a 10mbps connect with bandwidth and CPU to spare. (I wish I was joking or exaggerating on that account - but I've done that three times in the past four years now... The worst of those being a Ruby crapplet I ported to PHP). When you can take someones hosting costs and halve them OR MORE - that's worth the initial investment of the recode. Especially when you do that instead of throwing manpower and hardware at buggy bloated code then have the coder bill you in K-LoC.