G. Antonov
12-09-2004, 01:01 PM
I can't currently point you to a direct case (actually I'm thinking of one url but I suspect I'll be banned if I give it) but I've witnessed it many times: Internet explorer shows one thing, Firefox another. Usually the version given by IE looks better than that given by Firefox. Why does this happen? I mean, the code is the same. And sometimes the differences (bugs) are really noticable in different browsers.
the_pm
12-09-2004, 02:58 PM
It happens because some developers mistakenly believe that to make a site work in properly in IE, they have to foresake real browsers, standards and best practices. When these three are used and tested properly, not only can you avoid these problems today, you'll avoid them in the near future when super-compliant IE7 hits the market. At that point, there are going to be a lot of quickly disillusioned developers out there, and a lot of business up for grabs!
the_pm is right.
The best thing to do is to apply all presentation and design elements using css. Both IE and Mozilla support css, and it's fairly easy to write a compliant design.
If you have trouble making a single stylesheet render the same on different browsers. You can use php to to include a specific stylesheet depending on what browser the user is using.
here's some sample code you can use to show a specific stylesheet for IE users
<?
$browser = $_SERVER['HTTP_USER_AGENT'];
if(preg_match("/MSIE/i",$browser))//browser is IE
{echo('<link rel="stylesheet" href="ie.css" media="all" type="text/css" title="Internet Explorer Style" />');
}
?>
put that in your <head>.
the_pm
12-09-2004, 06:14 PM
the_pm is right
Every once in a great while it happen ;)
Does that mean that most Opera users will get the IE stylesheet? :( Most Opera users I know serve IE UA strings to bypass filters than ban non-IE/non-Moz users. It's a shame we have to got to such measures, but hopefully someday sites worthy of a mention on Dan's Web Tips Hall of Shame will get the message and open up their sites to all visitors.
Getty Images in on my most hated list now for doing this. The best part is that with UA spoofing in place, their site works perfectly in Opera, and I'd wager the same is true for most non-IE/Moz browsers. Poor Mac/Safari users. They get a message telling them to download IE for Mac or Netscape!