0

Due to some reason the application was designed to force the IE 7 rendering engine in IE 8+, using below META Tag

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

I want to apply some IE 7 specific styles like below.

 <!--[if lte IE 7]>
    <style type="text/css">
    #myElement
    {
       padding-bottom:49.00% !important;
    }
    </style>
<![endif]-->

Code Reference

I am opening the site in IE 8 and it emulates to IE 7 mode, but my styles are not getting applied here.

How do i detect IE 7 Emulate mode here? using jQuery(1.4.1) also welcome.

Note: The application was designed long time back, it is in maintanance mode. So not possible to upgrade jQuery version

Update: Finally I used

navigator.appVersion.indexOf("Trident")!=-1 
&& document.documentMode==7
Murali Murugesan
  • 22,423
  • 17
  • 73
  • 120
  • "*the application was designed to force the IE 7 rendering engine in IE 8+*" ... oh dear. That was your first mistake. – Spudley Dec 20 '13 at 12:56
  • @Spudley, I already read [Detect IE8 Compatibility Mode](http://stackoverflow.com/questions/1328963/detect-ie8-compatibility-mode). But how can i make it in programatically? – Murali Murugesan Dec 20 '13 at 12:59
  • Are you sure your browser is in the right mode? If you've changed the compatibility mode in IE, this header won't magically reset it. Use F12 & check would mode you're in – Simon Halsey Dec 20 '13 at 15:20
  • @SimonHalsey, `BrowserMode IE 8 , Document Mode IE 7` – Murali Murugesan Dec 20 '13 at 15:48

1 Answers1

0

Your conditional comment is incorrect:

 <!--[if lt IE 7]>

 should be

 <!--[if IE 7]>

The first one reads: All versions of IE less than 7

Mister Epic
  • 16,295
  • 13
  • 76
  • 147