gpt4 book ai didi

css - 将固定大小的页面缩放到屏幕宽度?

转载 作者:行者123 更新时间:2023-11-28 08:19:44 28 4
gpt4 key购买 nike

在 Android 版 Chrome 40 上,缩放固定宽度的页面以适应屏幕宽度很简单。一种使用 viewport 元标记并指定内容的宽度并禁用用户缩放:

Screenshot showing content scaled to width in Chrome 40 for Android

在 Firefox OS 2.2 模拟器中,相同的代码工作:

Screenshot showing content scaled to width in

如何在 Firefox OS 浏览器中使固定宽度的内容适应屏幕宽度?

代码:

  • index.html:

    <!doctype html>

    <title>Viewport test</title>
    <link rel="stylesheet" href="index.css" />
    <meta name="viewport" content="width=1000,user-scalable=0" />

    Test
  • index.css:

    * {
    margin: 0;
    padding: 0;
    }

    body {
    font-size: 50px;
    width: 990px;
    border: 5px solid lightblue;
    }

最佳答案

我使用了以下元标记并且它有效:<meta name="viewport" content="width=device-width, user-scalable=no">

关于css - 将固定大小的页面缩放到屏幕宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28820117/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com