Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you make a separate CSS for IE?

Tags:

css

I'm trying to figure out what is the best solution for me right now.

I was using CSS3 to make some rounded corners and drop shadows, but IE8 did not support it, so I had to use CSS3pie for IE8. Unfortunately, after applying the pie, it seems IE8 is just does not want to look the same as Chrome or FF. Why is IE such a hassle?

Should I just create a new style sheet for IE? or is there a better solution? Is there some kind of generator where you can convert your Firefox perfected CSS to IE?

like image 561
Strawberry Avatar asked Oct 08 '10 11:10

Strawberry


2 Answers

Should I just create a new style sheet for IE?

Yes, I think you'll have to add a separate CSS for IE, such as

<!--[if IE 8]><link rel="stylesheet" type="text/css" href="../CSS/ie8.css" media="screen" /><![endif]--> 

If it doesn't look right in IE8, it must be even worse in IE6! :)

Why is IE such a hassle?

Because the IE guys didn't pay as much attention to web standards, although that has improved.

like image 54
Joe Ratzer Avatar answered Nov 12 '22 15:11

Joe Ratzer


For IE, yes, and they are, as @Joe R notes, included via conditional comments. So at least there's no corruption, or invalidation, of the mark-up to provide specific support, which is a much improved situation than used to exist with the various css hacks.

In my case I also, so long as there's no overt restriction to the contrary, include a conditional comment somewhere on the page that pops up a modal dialogue linking to various other free browsers (typically Chrome, Firefox, Safari and Opera) and suggesting the users might like to up-grade in order to improve their experience.

Incidentally, I also don't bother trying to get pixel-perfect IE versions. If a client requests it, then fair enough, but normally explaining the cost-per-hour just to givie curvy-corners is enough of an incentive to allow for rectangular boxes in IE, and curves in FF, Chrome etc.

The main reason that IE seems to be such a pain is because, following the installation of IE as a free browser on Windows it peaked at around 90%+ market penetration, Netscape more or less died and, while there were niche browsers around, the majority of the Windows market seemed disinterested in pursuing alternatives. A lack of high market-penetration coupled with low-levels of competition stymied the market, and reduced the incentive to innovate and improve.

Only since, I think, Firefox began to attain adoption rates of 15%+ did the IE team, or the IE management team, pay attention, and pursue improvement. And even then, it seems to have taken 'til the IE9 development process to drive the adoption of standards.

like image 3
David Thomas Avatar answered Nov 12 '22 14:11

David Thomas