【问题标题】:Twitter bootstrap and max-width for mobile devices?移动设备的 Twitter 引导程序和最大宽度?
【发布时间】:2013-03-13 21:52:09
【问题描述】:

我想将移动设备的固定设置为 320 像素 - 我希望我的网站始终与 the screen for 320px 上的相同。

我试过在320px上设置固定宽度,像这样:

@media (max-width: 320px) {
    body {
        width: 320px;
    }
}

但是这段代码对我不起作用。有什么办法吗?

【问题讨论】:

    标签: css mobile twitter-bootstrap responsive-design


    【解决方案1】:

    您可以在 html 中使用元标记。

    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=320, height=device-height, target-densitydpi=medium-dpi" />
    

    【讨论】:

    • 其中一些不是必需的,但前几个参数是(用户可缩放、初始缩放、最大缩放、最小缩放)
    • @sevenseacat 曾经 target-densitydpi 在 android 上帮助过我
    • 能不能解决这个问题,如果是怎么办? stackoverflow.com/questions/24851785/…
    猜你喜欢
    • 2012-08-11
    • 2011-10-08
    • 1970-01-01
    • 2020-11-26
    • 1970-01-01
    • 1970-01-01
    • 2017-09-27
    • 2016-01-17
    相关资源
    最近更新 更多