Hiding styles from Internet Explorer for the Mac
Posted on Wednesday, December 13th (7121 days ago)
Of all the browser bugs, security holes and rendering issues ever discovered on the net, without a doubt the worst is Internet Explorer for Mac. Microsoft really outdid themselves that time. Thankfully the browser was discontinued some time ago, but none the less, there still exists users that prefer it.
The problem mostly lies in its horrid support for web standards like CSS. I use CSS exclusively to handle the presentation portions of web pages (the layout and pretty things). It works great. Its the recommended best practice. Not in IE Mac.
IE Mac butchers CSS layouts so badly, and now has so few users that I feel its time, to drop IE Mac support completely. This means that IE Mac users will have a plain, boring page instead of a broken layout. I feel this is better since the IE Mac users will still have full access to the content of the page.
How is this done? It’s actually quite simple. Either in your HTML/XHTML or CSS file, simply do something like this:
/* hide all styles from ie/mac */
@import url("stylesheet.css");
/* end hide */
Here’s how it works: ” /* ” denotes an opening mark for a comment that is not parsed (read) by the browser. ” */ ” represents the end of the comment. IE Mac has a little parsing bug. If you add in a back slash ” \ ” before the end of your comment, IE Mac will treat everything following that back slash as a comment until it reaches another ” */ “.
This allows you to place any styles you want it to ignore safely inside. All other browsers will read the stylesheets just fine.
About Joseph R. B. Taylor
Joseph R. B. Taylor is a humble designer/developer who makes stuff for screens of all shapes and sizes. He is currently the lead UI/UX Architect at MScience, LLC, where he works to create simple experiences on top of large rich datasets for their customers and clients.