即只有最小宽度的样式

问题描述 投票:1回答:1

如何将仅ie媒体查询与最小宽度媒体查询(我读IE是唯一不支持嵌套媒体查询的浏览器)相结合-例如,我使用

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

所以我想我可以做

@media screen and (min-width: 1024px) and (-ms-high-contrast: active), (-ms-high-contrast: none) {}

但是此功能仍在1024px以下使用。如何将最小宽度和媒体查询结合在一起,以便仅在1024px以上的像素中应用它?

((我打算制作一个片段,但是无论如何它们都无法使用,所以让我知道您是否需要更多信息,但是上面的代码足以复制我的问题)

css media-queries
1个回答
1
投票
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {}

所以当]时触发mediaquery>

@media screen and (-ms-high-contrast: active)

(-ms-high-contrast: none)

如果要添加其他条件,则需要将其添加两次

@media screen and (min-width: 1024px) and (-ms-high-contrast: active), 
       screen and (min-width: 1024px) and (-ms-high-contrast: none) {}

[[[

© www.soinside.com 2019 - 2024. All rights reserved.