【问题标题】:Optimize web page for mobile优化移动网页
【发布时间】:2011-07-09 13:42:10
【问题描述】:

我试图让我的网页在用户浏览时放大显示。整个页面应仅 320 像素宽对齐,将所有内容放在一列中。但是当我转到该页面时,该网站看起来并不好,直到查看者点击屏幕进行缩放,即使这样他们也可以水平滚动(什么也看不到)

如何自动缩放页面?

我应该把所有东西都居中对齐吗?

我的css和html如下:

* {

margin: 0;

padding: 0;

}
body.body_sp{background-image:url(../images/content_sp.jpg);background-repeat:repeat-x;background-repeat:repeat-y;width:320px;}
#head_sp{width:320px;height:127px;}
#content_sp{width:320px;}
#footer_sp{width:320px;}

h1.sp_h1{margin:10px 0 20px 5px;text-align:left;}
p.sp_p{margin:20px;letter-spacing:.5px;line-height:16px;font:13px arial;}
p.sp_p a{color:red;}

你可以在这里看到我的 html http://patriotsar.com/patriot_droid.php

【问题讨论】:

    标签: android html css mobile


    【解决方案1】:

    尝试将这些添加到您的

    <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/> 
    <meta name="apple-mobile-web-app-capable" content="yes" /> 
    

    【讨论】:

    • 我确实设置好了。抱歉,上面的代码一定是我拿出来测试的时候。我会重新编辑它。
    猜你喜欢
    • 1970-01-01
    • 2011-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-10
    相关资源
    最近更新 更多