Restrict CSS to IE

2

Is something missing in this parameter? I need this style to apply only to IE 11, when I include this code it works, but other browsers also get

<!-- [if gte IE 8]-->
    <style>
        .box-form .logo-footer {
            margin-top: -2vh!important;
            margin-bottom: -9vh!important;
            margin-left: 44px!important;
        }
    </style>
<!--[endif]-->
    
asked by anonymous 04.01.2018 / 14:55

1 answer

1

Just for IE10 and IE11 you can do so!

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .box-form .logo-footer { 
        margin-top: -2vh!important;
        margin-bottom: -9vh!important;
        margin-left: 44px!important;
    }
}

Here you have more complete documentation.

link

Hack test in IE11 on Windows 10 and Chrome 63

On Chrome 63

InIE11,noticetheredsquareinthelowerrightcorner"11"

  

CodeIused

<style>.teste{width:100px;height:100px;background-color:red;}@mediascreenand(-ms-high-contrast:active),(-ms-high-contrast:none){.teste{width:100px;height:100px;background-color:black;}}</style></head><body><divclass="teste"></div>

</body>
    
04.01.2018 / 15:05