How to scale a website for mobile devices?

僤鯓⒐⒋嵵緔 提交于 2019-11-29 02:31:28

问题


I've a very simple static web page (only css and links, no scripts). It looks good on android and iphone, but too small. I'm guessing they put it smaller since it work for most of the sites. How can I override this and make him look the size I want it to be?


回答1:


Android automatically adjusts to the size of your site, try to use width:100% or smaller than around 310 pixels (scrollbar takes space) for normal viewmode.

For IPhone try using this code to force the correct size

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

Also to force font-size try to use this code in your css:

-webkit-text-size-adjust: none;



回答2:


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

The list should be comma-separated.



来源:https://stackoverflow.com/questions/2361846/how-to-scale-a-website-for-mobile-devices

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