简体   繁体   English

Internet Explorer忽略@media屏幕

[英]Internet explorer ignore @media screen

i am working on responsive design for web page. 我正在为网页设计响应式设计。 I am loading some data with ajax to render forms. 我正在使用ajax加载一些数据以呈现表单。 I can't find reason, why only internet explorer browser after rendering think, that width is lower than 768px(so it use my responsive template). 我找不到原因,为什么只有Internet Explorer浏览器渲染后才认为宽度小于768px(所以它使用了我的响应模板)。 It must run on ie9 and upper. 它必须在ie9及更高版本上运行。 Any idea, why only ie ignores @media or can be there another problem, why it doesn't work: 任何想法,为什么只有ie忽略@media还是会出现另一个问题,为什么它不起作用:

@media only screen and (max-width:767px){   
#topmenu-responsive{
width: 80%;
}
}

i try: 我尝试:

<meta http-equiv="X-UA-Compatible" content="IE=edge,9,10,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>  

but still nothing. 但还是一无所有。

Your Code Completely Work Fine. 您的代码完全可以正常工作。 Check this url Diffrent Diffrent Browser . 检查此URL Diffrent Diffrent Browser i also check it. 我也检查一下。

See Live Demo Here 在这里 观看现场演示

Snippet Example 片段示例

 @media only screen and (max-width:767px){ #topmenu-responsive{ width: 80%; background:red; border:1px solid black; } } 
 <meta http-equiv="X-UA-Compatible" content="IE=edge,9,10,chrome=1"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <div id="topmenu-responsive"> topmenu-responsive Div </div> 

Internet Explore 11 互联网浏览11

在此处输入图片说明

FirFox 狐狸

在此处输入图片说明

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

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