1

I have a CSS3 linear gradient in my HTA that won't display in IE10 or IE 11 unless I have the 'meta http-equiv="x-ua-compatible" content="IE=edge"' tag in my HTA. If I don't have this it just displays a white background. This is the CSS....

html {
       height: 100%;
}

body {
       background-image:
            linear-gradient(to bottom, #800000 0%, #DB7093 100%); 
       filter:
            progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#800000', EndColorStr='#DB7093');

       height: 100%;
       margin: 0;   
       background-repeat: no-repeat;
       background-attachment: fixed;
       font: 14 pt arial;
       color: white;
}

As long as I have the META tag it works fine, but my question is why doesn't it work without this tag?? Surely I don't have to be in Compatibility mode if I am using the latest version of IE with the latest syntax?

<html>
  <head>
     <meta http-equiv="x-ua-compatible" content="IE=edge" />
     <HTA:application id="main" applicationName="Test HTA" />

     <link rel="stylesheet" type="text/css" href="test.css" />
pistolpedro
  • 11
  • 1
  • 2
  • Surely you do need the `x-ua-compatible`. Notice, that HTAs are not run by IE, they are run by mshta.exe. Please see [Javascript version in HTA](http://stackoverflow.com/a/19570684/1169519). – Teemu Dec 23 '13 at 06:27
  • 2
    The assumption Windows makes with HTA is that they may need to be in compat mode to work properly since many were written 10 years ago or more. Therefore you have to opt-in by using X-UA-Compatible. And don't call me Shirley. – Dave Methvin Dec 23 '13 at 19:47
  • Thanks for your replies, it makes more sense now. – pistolpedro Dec 24 '13 at 02:40
  • @DaveMethvin I'd just like to tell OP good luck, I'm sure his client is counting on him. – Dai Mar 25 '15 at 21:00

1 Answers1

0

If you add a Windows Registry key for mshta.exe under FEATURE_BROWSER_EMULATION you can make your HTA default to IE10/IE11 mode without the need of a meta tag. This is documented http://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx but to save you time, the registry key is:

New DWORD (32-bit) Value
Name: mshta.exe
Value: 0x00002AF9 (11001)

On a 32-bit Windows machine, it's located under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

On a 64-bit Windows machine, it's located under:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION
Stephen Quan
  • 21,481
  • 4
  • 88
  • 75
  • For those wishing to To set FEATURE_BROWSER_EMULATION in HKCU instead of HKLM, the same key is used on 32 bit and 64 bit: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION – LesFerch Aug 13 '21 at 02:41