Small fonts in mobile website

若如初见. 提交于 2019-12-12 20:26:35

问题


I have developed a mobile website and it shows perfectly to me in Android and IPhone emulator. However, when I try to view it on an Android phone or IPhone, it displays the website as a normal desktop website viewed on phone with very high widths and fonts appearing very small. The issue gets resolved, if I double click/tap on my screen.

Any help would be greatly appreciated.

I got this on stackoverflow..but not much sure about it


回答1:


You need to add a meta tag named "viewport" see sample below

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="Content-Style-Type" content="text/css">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1" />
</head>
<body style='background-color:white;font-family:Arial,Tahoma,Verdana;'>
</body>
</html>


来源:https://stackoverflow.com/questions/8731793/small-fonts-in-mobile-website

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