2017-05-31 79 views
0

我建立了一个响应式设计的网站。在Chrome,Mozilla Firefox,Opera中一切正常,但Internet Explorer(版本10,11也)在桌面PC上显示平板电脑版本。我如何强制IE使用桌面版?先谢谢你。媒体查询如下:在Internet Explorer中的响应式设计

@media only screen and (min-width: 481px) {}\\ for Tablet 
@media only screen and (min-width: 769px) {} \\for Desktop PC 
+0

您需要IE附加代码:HTTPS:/ /msdn.microsoft.com/en-us/library/hh869615(v=vs.85).aspx – Gerard

+0

IE 10和11支持媒体查询。你能分享你的CSS包括那些媒体查询吗? –

+0

@Gerard,谢谢你的努力。我在链接中尝试了解决方案,但无法使其工作。对于屏幕最小宽度:481px我应该添加@ -ms-viewport {width:481px; }。正确? –

回答

0

下面的代码加载mystyles.css在所有浏览器和负载仅在Internet Explorer 8 complex.css:

<link rel="stylesheet" media="screen and (min-width:600px)" href="mystyles.css" /> 

<!--[if (IE 8)]> 
<link rel="stylesheet" media="screen" href="complex.css" title="complex layout" /> 
<![endif]--> 
+0

我应该为Internet Explorer使用单独的css文件吗?这个代码必须在每个页面中? –

+0

IT添加在头文件 –

+1

当我将此字符串添加到标题时,它在移动设备上无法正确显示 –