July 7, 2006

IE for the Mac and CSS

Filed under: CSS — chris @ 8:51 pm

If you’ve ever styled a HTML site using CSS (which is the only way to go if you ask us at chickenBeak) you’ve probably had somebody look at your site using Internet Explorer 5 for the Mac. If this happened to you, I imagine you found yourself boggled at the fact that this browser really didn’t like your code at all, chewing up and spiting out the site looking like a bad piece of seaweed.

IE5 for the Mac is not a browser I ever recommend to be used by anyone. However, It’s not our place as the web designer to tell a client what browser they should be using. In fact, the only time I’ve seen somebody using the browser is when he or she was forced into it one way or another. Despite security risks, no support, and Microsoft not even serving it to the public, it should be hard to come by. But there are still some Internet apps that run only on the unique non-standard features of IE for the Mac.

Anyway, how do you get CSS to work on IE5? It’s actually easy. There are a few things to keep in mind.

There are two flavors of IE5

There is IE5 and IE5.2 for the Mac. While there are some JavaScript issues with IE5 you won’t run into with IE5.2, there is not much different from a design point of view. Both will display background images and for the most part hold the CSS structure of a design pretty good. If the viewer is using OS8 or OS9, IE5 is the only option. If using OSX, they will probably be using IE5.2.

Use double quotes in your CSS

When including a background image, or any other time you use quotes within CSS, remember to use Double Quotes and Not Single Quotes. Internet Explorer likes “, not ‘. It just does, so use them. After I figured this I was suppressed with how many sites I designed worked in IE5 and 5.2 that I had thought previously did not.

If all else fails, there is a hack

First of all, I don’t recommend relying on CSS hacks; they may cause un-expected results in future browsers. If used, use sparingly, like to hide only a couple lines.

There is a glitch in how the IE5 and IE5.2 for the Mac interpret CSS comments. If used correctly, you can add CSS styles that will be used only in these two browsers, and ignored by all others. To do this, in the CSS use the following syntax.

/*\*//*/
.ie5ClassHere {display: none;}
/**/

This is called the “Band Pass Filter” hack, I read about it at http://www.stopdesign.com/examples/ie5mac-bpf/ a while ago. To find out the details of this hack, follow the link. It seems to be a small hack that will not mess up future browsers, and will allow for some nice IE5 only CSS rules.

That’s all I have. The point of this long and possibly over thought article is that even though the use of IE5.2 for the Mac is quickly dwindling, it’s not that hard to include those users in the world of CSS.

1 Comment »

  1. Chris,

    You’re right, its not that hard to deal with IE5 for Mac most of the time. But how much time should you waste on a browser so pathetic that msn.com (ah, the Microsoft Network) will not even display properly?

    I am usually willing to spend up 30 minutes. If I can’t fix what I need by then, tough luck for the less than 1% of Internet users still cruising around on IE5 for Mac. You just can’t please everyone.

    Also, I believe no quotes instead of doubles or singles for background images works just fine as well.

    Nice article.

    Comment by Mike — July 18, 2006 @ 9:15 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.