A way to hide styles from all browsers but IE5 Mac

Years before the discovery of responsive web design, when massive Internet Explorers roamed the earth, and hadn't yet started to go extinct, a typo in a web design I was working on led me to discover this method of serving style sheets to IE5 Mac only. It validates. It also appears to work for IE 4.5 Mac, although the limitations of this are unconfirmed, and the browser now an extreme rarity

The IE Mac sheet is linked like this:
<style type="text/css">
@import("ie51.css");
</style>

The essential requirements are to ommit 'url' and leave no space between @import and ("

This text should be red

It is red in Mac IE 4.5 through 5.23 on OS9 and OSX

It is presumed the default colour on all other browsers and has actually been tested on:

PC

Mac

Linux

Test cases

This text should be red, the css for this is in a different directory
This text should be black in all browsers, there is a space between @import and ("

 

Two biggest Mac IE 5 CSS Gotchas

1. You MUST declare a width for any floated element

2. If trying to do forms without tables, remove any new lines in the HTML between elements intended to be on the same line in the rendered page. Example:

<div>
<span><label for="realname">name</label></span><input name="realname" id="realname" type="text" size="30" maxlength="50" />
</div>

NOT:

<div>
<span><label for="realname">name</label></span>
<input name="realname" id="realname" type="text" size="30" maxlength="50" />
</div>

 

Info by Premonition 2003

More information on css web design browser hacks And even more here: CSS tricks.