【发布时间】:2019-11-03 04:17:14
【问题描述】:
我正在尝试仅在一个浏览器 (IE) 中使用媒体查询,但我尝试过的都没有。
例如:
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
/* Styles go here for IE */
@media screen and (max-width: 700px) {
.article {
width: 100%!important;
}
}
}
我正在尝试让媒体查询仅适用于 IE,而不适用于其他任何东西,但这没有任何影响。我也试过:
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none), (max-width: 1320px) {
div#desktop-nav {
padding-left: 0px!important;
padding-right: 0px!important;
}
}
我将最大宽度添加到媒体查询的末尾。
如果有人知道如何针对特定浏览器进行媒体查询,请告诉我
【问题讨论】:
-
您需要提供一个minimal reproducible example,这样我们才能看到它实际上不起作用。
-
另外,您要定位哪些 IE 版本?
标签: html css internet-explorer media-queries