issue with viewport meta tag

一个人想着一个人 提交于 2019-12-25 03:59:29

问题


I need my website to adjust itself according to the device. I used the following viewport meta tag:

<meta name="viewport" content="user-scalable=no,width=device-width, height=device-height, minimum-scale=0.1, maximum-scale=0.65" />

It works alright on iPhone. but on android it looks it doesn't responded to it at all even when I change the scale values. Is there a different tag for android?


回答1:


You should use the same tag for Android, but there are a few differences how different platforms calculate initial scale from viewport size, or viewport size if not set. Also keep in mind that initial-scale only works first time you load the page, if you reload the page it will keep the scaling that you currently have.

I'm unsure what result you are looking for, but you have a great reference for Android here ( http://developer.android.com/guide/webapps/targeting.html ) and for Iphone here ( http://developer.apple.com/library/safari/#documentation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html ).

Also, you can google for "tale of two viewports" (i was unable to post link because of low reputation)



来源:https://stackoverflow.com/questions/6075522/issue-with-viewport-meta-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!