-1

Does anybody know of a CSS selector that will only work in IE11 down. I have tried google etc but can't seem to find one that actually works?

BennKingy
  • 1,265
  • 1
  • 18
  • 43

1 Answers1

1

You could use conditional statements to generate different elements with IE specific classes:

<!DOCTYPE html>
<!--[if IEMobile 7 ]> <html dir="ltr" lang="en-US"class="no-js iem7"> <![endif]-->
<!--[if lt IE 7 ]> <html dir="ltr" lang="en-US" class="no-js ie6 oldie"> <![endif]-->
<!--[if IE 7 ]>    <html dir="ltr" lang="en-US" class="no-js ie7 oldie"> <![endif]-->
<!--[if IE 8 ]>    <html dir="ltr" lang="en-US" class="no-js ie8 oldie"> <![endif]-->
<!--[if (gte IE 9)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html dir="ltr" lang="en-US" class="no-js"><!--<![endif]-->

source: https://css-tricks.com/snippets/html/add-body-class-just-for-ie/

Renaud C.
  • 535
  • 2
  • 14
  • While this may answer the question, please add the relevant code to the answer itself and not just a link. If that link ever disappears, this answer will become useless. – disinfor Oct 31 '19 at 13:58