scriptygoddess

02 Sep, 2004

Code for IE's eyes only

Posted by: Jennifer In: Lessons learned

While we're on the subject of IE funkiness – I ended up on Toothpaste Addict tonight and noticed this little trick. (Actually, something weird happend when I copied and pasted the code from Toothpaste. Must have something to do with the text formatting there. But I found this page – which actually shows the same code, but copying/pasting that one worked)

<!–[if IE]>
IE 5.0 – 6.0 will be the only browsers to see this line.
<![endif]–>

6 Responses to "Code for IE's eyes only"

1 | Frank

September 3rd, 2004 at 6:57 am

Avatar

The problem with Toothpaste Addict is that probably a double minus sign was automatically converted in a single mdash by a text parser like Smarty.

In fact, this is probably the least hacky and most optimal way to send the buggy IE browsers an alternate stylesheet. You can also target the different IE browsers individually, like send IE5 a separate stylesheet from the one you send to IE5.5 or IE6. Check out this write-up.

2 | GG

September 3rd, 2004 at 8:46 am

Avatar

Yeah, this is excatly how we get the Firefox logo to show up on the top of the page for IE users over at RepTIDE.

3 | J.A.S.O.N.

September 3rd, 2004 at 10:36 am

Avatar

For IE users
If you point IE to my website, you'll notice a special little message specially designed for IE users.

Thanks to Scripty Goddess for the code.

I can't wait to hear about what people come up with. I can't say "see" because I NEVER user IE.

4 | Valerie

September 6th, 2004 at 11:04 am

Avatar

Okay so what about css? If I need it to do one thing for Mozilla and another for IE, what do I do? I know this is a bit unrelated, but I can't find this anywhere else so far…

5 | Bob S

September 7th, 2004 at 11:11 am

Avatar

I just noticed this trick used on Wikipedia. Checking the Wayback Machine, I see they've been using it since at least July. I heard it here first, though!

Must resist temptation to show IE users picture of Goatse Bob. ("If you weren't using IE, you wouldn't see this". Ooooh, soooo tempting.)

6 | Bob S

September 7th, 2004 at 11:27 am

Avatar

Valerie,

The tendency is that IE works one way, while Everything Else supports W3C standards. So don't think in terms of what you want to do in Mozilla, but try to focus on Web standards, and use this trick to fix IE-specific problems.

Remember, nobody designed this trick; it's a rare instance in which Microsoft's lax ideas of how broken HTML should be interpreted can, by total coincidence, be used to make pages work on both categories of browsers (i.e., IE and Everything Else).

If I understand CSS correctly, what you can do is define your normal (W3C-compliant) stuff first, then use this trick to supply the IE CSS, which will override whatever preceded it.

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements