媒体查询不适用于ie10 [英] media query is not working on ie10

查看:708
本文介绍了媒体查询不适用于ie10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个响应式网站,我在我的CSS中使用媒体查询。
在chrome和FF上看起来一切都很好但ie10忽略了我的所有查询。
i有< meta name =viewportcontent =width = device-width,user-scalable = no,initial-scale = 1> on标题,因为该网站设置为平板电脑。
i试图删除元标记并且它没有解决问题。

i made a responsive site and i'm using media queries in my css. everything is looking good on chrome and FF but ie10 is ignoring all my queries. i have <meta name="viewport" content="width=device-width,user-scalable=no, initial-scale=1"> on the header because the site is set for tablets. i tried to delete the meta tag and it didn't solve the problem.

我几乎尝试了所有事情:

i tried almost everything:

@media only screen and (max-width: 800px), only screen and (max-device-width: 800px) 
@media only screen and (max-width: 800px)
@media screen and (max-width: 800px)
@media all and (max-width: 800px)
@media (max-width:800px) 

似乎无效。

推荐答案

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

把你的东西放在这里,IE 10黑客不同于旧版本的IE。并在媒体查询中使用它

Put your thing within this, the IE 10 hack unlike older version of IE. and use this within media queries

@-ms-viewport { width:device-width; zoom:1.0; }

这篇关于媒体查询不适用于ie10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆