Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为iphone设计网站_Iphone_Css - Fatal编程技术网

为iphone设计网站

为iphone设计网站,iphone,css,Iphone,Css,我正在为iphone编写一个网站。我们的设计师把尺寸为320 x 480的图片传给我,所以我也根据这个尺寸对网页进行编码。然而,当我在iphone中预览时,网站看起来非常小。如何解决这个问题 我的容器大小是320px 谢谢。在桌面上试试这个 <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> ...and on y

我正在为iphone编写一个网站。我们的设计师把尺寸为320 x 480的图片传给我,所以我也根据这个尺寸对网页进行编码。然而,当我在iphone中预览时,网站看起来非常小。如何解决这个问题

我的容器大小是320px


谢谢。

在桌面上试试这个

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
...and on your body

<div style="width: 320px; margin: 0 auto;"> 
<!--some code here-->
</div>

…在你身上

然后您可以在…

测试它,尝试将以下元元素添加到标题中:

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

然后将容器宽度设置为100%。这个标签最初由Safari支持,但现在许多其他移动浏览器都支持它

请记住,如果用户将设备旋转到横向透视,则宽度将为480px。如果您希望用户将设备保持在纵向模式,可以将设备宽度设置更改为320。

使用以下代码:

<div style="width: 100%; margin: 0 auto;"> 
<!--put other code here-->
</div>