0

对于不同的浏览器宽度,我有 3 种替代布局。在我的 index.html 中用 CSS 编码,如下所示:

<link rel='stylesheet' media='screen and (max-width: 640px)' href='narrow.css' />
<link rel='stylesheet' media='screen and (min-width: 641px) and (max-width: 1200px)' href='med.css' />
<link rel='stylesheet' media='screen and (min-width: 1201px)' href='wide.css' />

当我更改浏览器窗口大小以及在几个响应式布局测试页面中对其进行测试时,它可以在我的桌面上完美运行。
问题:在我的移动设备(iphone 5)上,在任何浏览器中都不起作用:它使用了错误的屏幕尺寸布局。atm 无法在其他设备上测试。
有什么建议么?

4

1 回答 1

0

检查您的 HTML 代码中的元标记,它应该是

<meta name="viewport" content="width=device-width, initial-scale=1.0">

那么只有它才能在设备上工作

另请参阅以下链接

https://css-tricks.com/snippets/html/responsive-meta-tag/

于 2016-09-29T08:08:55.690 回答