Topic: IE vs other browsers?

Anyone have any nice tricks to apply css to only one type of browser?

I have yet to run into a difference with gecko based browsers (mozilla) and Opera; But IE never seems to display the same way, and even different version of IE render pages drastically different.

At the moment in most of my xhtml files I have this in the header:

                <link rel="stylesheet" type="text/css" href="./css/default.css" />
                <!--[if IE]>
                <link rel="stylesheet" type="text/css" href="./css/default.ie.css" />
                <![endif]-->
                <!--[if IE 5]>
                <link rel="stylesheet" type="text/css" href="./css/default.ie5.css" />
                <![endif]-->
                <!--[if IE 5.5]>
                <link rel="stylesheet" type="text/css" href="./css/default.ie55.css" />
                <![endif]-->
                <!--[if IE 6]>
                <link rel="stylesheet" type="text/css" href="./css/default.ie6.css" />
                <![endif]-->

Then in each ie css I just override the default definitions to suite IE, and again for each version of IE.

Anyone else use something like this? And how different is the safari based browsers VS mozilla/Opera? Anyone ever have to hack and slash at safari browsers, like I do IE?

echo "deadram"; echo; fortune;

Re: IE vs other browsers?

Well, you can use Javascript to apply CSS rules by browser.

In the absence of Javacsript, you can use -- with care -- so-called "CSS hacks". Sitepoint has a decent overview article concerning them.

deadram wrote:

And how different is the safari based browsers VS mozilla/Opera?

Safari uses a derivative of the KHTML engine, so you can use Konqueror on Linux or Swift on Windows to get a rough idea of how a page might render in Safari.

Looking for a certain modification for your forum? Please take a look here before posting.

3

Re: IE vs other browsers?

When it gets really tricky is when you encounter differences between so called standards compliant browsers. One of the nastier ones is that the Gecko 1.7 engine (used by current versions of Mozilla and Firefox 1.0.x) has serious bugs which were fixed in Gecko 1.8. I have found myself having to use different css for FF1.0.7 and FF1.5 which is not easy. FF1.5 also has a serious fieldset bug which none of the other browser have. Safari has several positioning bugs which mean it has to be fed position relative in circumstances where that could screw up something in IE.

I think having more than one IE specific stylesheet is overkill as it is easy to distinguish between IE6 and IE7 within the same stylesheet. IE5 doesn't need very much specific to that version and when it does it can normally be applied without screwing up IE6.