本文介绍了仅适用于媒体查询中的IE 11屏幕尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有以下针对宽度的媒体查询.

I currently have following width specific media query.

 @media only screen and (max-width: 1920px) {
    .toggleMultiSelect .filter {
        width: 566px;
    }
 }

但是在Chrome/Firefox中," .toggleMultiSelect .filter "的宽度在IE中发生了变化.因此,对于IE,基本上需要为1920px中的同一CSS类应用不同的宽度.从Stackoverflow搜索中,我发现可以实现IE特定行为,如下所示.

But the width for '.toggleMultiSelect .filter' changes in IE from Chrome/Firefox. So basically need to apply different width for the same css class in 1920px for IE. From the Stackoverflow search I found that IE specific behavior can be achieved like below.

@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .toggleMultiSelect .filter {
        width: 575px;
    }
}

所以现在我需要同时实现解析度和CSS类. 575px 宽度仅应应用于IE,而Chrome或firefox的宽度应为 566px .

So now I need to achieve both resolution and css class. 575px width only should apply to IE and Chrome or firefox should get 566px.

在此先感谢您的帮助.

Thanks in advance for any help.

推荐答案

在媒体查询中使用以下CSS

Use the below css inside the media query

IE 10及更高版本

_:-ms-lang(x), .ie10up {
       property:value;
    }

IE 11及更高版本

_:-ms-fullscreen, :root .CLASS_NAME {
       property:value;
     }

这篇关于仅适用于媒体查询中的IE 11屏幕尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 21:20