79711695

Date: 2025-07-23 10:15:24
Score: 0.5
Natty:
Report link

Use Javascript to sniff the user agent string.

If the string contains "MSIE" it's an older version of IE, and if it contains "Trident" it's a newer version. This page has a list of the user agent strings for various versions of IE on various operating system versions.

When the Javascript runs, if IE is not detected then add a class to the body element. In your CSS, make all your style rules dependent on that class being present.

What's the benefit of doing this though? How many of your website visitors are browsing with Internet Explorer?

Reasons:
  • No code block (0.5):
  • Ends in question mark (2):
  • High reputation (-2):
Posted by: Brett Donald