简体   繁体   English

CSS 媒体查询在 Microsoft Edge 上不起作用

[英]CSS media query do not work on Microsoft Edge

 @media (min-width: 992px) and (max-width: 1140px) 
{
  .mr-1024-none
  {
        margin-right: 0px !important;
  }

  .mt-1024
  {
        margin-top: 1rem !important;
  }  

   .d-1024-none 
   {
        display: none !important;   
   }

}

I have used the above code for solving issue on ie and edge.我已经使用上面的代码来解决 ie 和 edge 上的问题。 The above media query works fine on ie but doesnot work on edge.上面的媒体查询在 ie 上工作正常,但在边缘上不起作用。 After searching enough i found that edge does not support media query.搜索足够多后,我发现边缘不支持媒体查询。 Can someone help me out!!!有人可以帮我吗!!!

As you're using bootstrap, are you sure you're calling your custom stylesheet after Bootstrap call ?当您使用引导程序时,您确定要在引导程序调用之后调用自定义样式表吗? If not, bootstrap rules will take over your custom stylesheet.如果没有,引导规则将接管您的自定义样式表。

I had quite same problem.我有同样的问题。 If under your min-width the style is the same as between min-width and max-width, remove min-width and it will work.如果在您的最小宽度下样式与最小宽度和最大宽度之间的样式相同,请删除最小宽度,它会起作用。 And yes, you have be sure you're calling your custom stylesheet after Bootstrap.是的,您已经确定在 Bootstrap 之后调用您的自定义样式表。

@media screen and (max-width: 1140px) {...} @media 屏幕和 (max-width: 1140px) {...}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM