IE11 @media 宽度

IE11 @media with width

对于 IE11,我使用以下@media 查询:

@media all and (-ms-high-contrast: none), (-ms-high-contrast: active){}

效果很好。

但现在我还想为手机、平板电脑和台式机提供 3 个不同的版本。我尝试了以下方法:

@media all and (-ms-high-contrast: none), (-ms-high-contrast: active), only screen and (min-width : 1200px) {
    max-width: 83%;
}

@media all and (-ms-high-contrast: none), (-ms-high-contrast: active), only screen and (min-width : 768px) and (max-width: 1199px) {
    max-width: 90%;
}

@media all and (-ms-high-contrast: none), (-ms-high-contrast: active), only screen and (max-width : 767px) {
    max-width: 100%;
}

但它总是落在最后一个最大宽度为 100% 的位置。我试过将宽度放在 -ms-high-contrast 之前,但它似乎具有相同的效果。关于解决此问题的任何提示?

认为您正在寻找更像的东西;

// Extra small devices (portrait phones, less than 576px)
@media screen and (-ms-high-contrast: active), 
                  (-ms-high-contrast: none) 
              and (max-width: 575.98px) { ... }

// Small devices (landscape phones, 576px and up)
@media screen and (-ms-high-contrast: active), 
                  (-ms-high-contrast: none) 
              and (min-width: 576px) 
              and (max-width: 767.98px) { ... }

// Medium devices (tablets, 768px and up)
@media screen and (-ms-high-contrast: active), 
                  (-ms-high-contrast: none) 
              and (min-width: 768px)
              and (max-width: 991.98px) { ... }

// Large devices (desktops, 992px and up)
@media screen and (-ms-high-contrast: active), 
                  (-ms-high-contrast: none) 
              and (min-width: 992px)
              and (max-width: 1199.98px) { ... }

// Extra large devices (large desktops, 1200px and up)
@media screen and (-ms-high-contrast: active), 
                  (-ms-high-contrast: none) 
              and (min-width: 1200px) { ... }