宽度=设备宽度在移动 IE 中不起作用 [英] width=device-width not working in Mobile IE

查看:23
本文介绍了宽度=设备宽度在移动 IE 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个在手机上运行良好的网站.到目前为止,我测试过的每部手机都运行良好,但带有 Windows Mobile IE 的手机.似乎移动 IE 只是读取 <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"/> 并且未将宽度设置为设备宽度.

I'm trying to make a website that works well on mobile phones. So far every phone that I have tested works well, but phones with Windows Mobile IE. It seem that Mobile IE just reads over the <meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"/> and is not setting the width to device-width.

有没有人有这方面的经验或任何使网站在移动 IE 上更好地查看的技巧?

Anyone have any experience with this or any tips of making the site better viewed on Mobile IE?

感谢您的帮助!

推荐答案

如果您指定实际宽度,移动 IE 似乎只尊重视口元标记.要使页面宽度与实际设备宽度一致,请使用针对移动设备优化的元标记,并将内容设置为 0:

Mobile IE seems to only respect the viewport meta tag if you're specifying an actual width. To get the page width to follow the actual device width, use a mobileoptimized meta tag with content set to 0:

有关 MSDN 的详细信息:http://msdn.microsoft.com/en-我们/图书馆/dd938878.aspx

Details on MSDN: http://msdn.microsoft.com/en-us/library/dd938878.aspx

如果您将其与上述视口元标记结合使用,这应该会提供您在大多数移动浏览器中寻找的内容.

If you combine this with the viewport meta tag as above, this should give you what you're looking for across most mobile browsers.

这篇关于宽度=设备宽度在移动 IE 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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