uk
V2EX  ›  问与答

手机浏览器为什么会把web元素放大1.5倍呢?

  •  
  •   uk · Oct 29, 2012 · 3400 views
    This topic created in 4943 days ago, the information mentioned may be changed or developed.
    我就不信这个贴还没人回!
    3 replies    1970-01-01 08:00:00 +08:00
    for4
        1
    for4  
       Oct 29, 2012
    没有吧 什么手机什么浏览器?

    PS 感谢我吧...
    uk
        2
    uk  
    OP
       Oct 29, 2012
    @for4

    安卓
    <meta name="viewport" content="width=device-width; target-densitydpi=high-dpi; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0 user-scalable=no"/>

    target-densitydpi=high-dpi 这个对安卓的UC, 百度, 360, QQ等都有效; 而对欧鹏, 火狐等却无效,他们会把元素尺寸放大 1.5 倍

    不用 target-densitydpi=high-dpi 的话浏览器显示的元素尺寸是 1*1.5, 请问这是什么问题呢?
    Archangel_SDY
        3
    Archangel_SDY  
       Oct 29, 2012   ❤️ 1
    target-densityDpi已经从草案中移除, UC等用的是Android的WebKit改的所以还没有合并最新的补丁.

    参见:
    https://bugzilla.mozilla.org/show_bug.cgi?id=737090
    https://bugs.webkit.org/show_bug.cgi?id=88047

    关于1.5倍可以参见这里的Building web pages to support different screen densities一节:
    http://developer.android.com/reference/android/webkit/WebView.html
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   926 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 230ms · UTC 21:20 · PVG 05:20 · LAX 14:20 · JFK 17:20
    ♥ Do have faith in what you're doing.