Html 移动 CSS 页面宽度

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5236326/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 07:12:41  来源:igfitidea点击:

Mobile CSS Page width

htmlcssmobilemobile-website

提问by Rick

Trying pretty hard to make simple form page viewable in mobile devices. The form is viewable, just that I have to zoom in a lot to read it.

非常努力地使简单的表单页面在移动设备上可见。表格是可见的,只是我必须放大很多才能阅读它。

Hear is an example:

听到是一个例子:

http://200.5.3.20/temp/PocketPC/dispatch.php

http://200.5.3.20/temp/PocketPC/dispatch.php

回答by jonezy

You can add the meta viewport tag that will scale the page to the device width:

您可以添加将页面缩放到设备宽度的元视口标签:

<meta name="viewport" content="width=device-width, initial-scale=1.0">

You can read up on it here too.

你也可以在这里阅读它。

回答by Aditya P Bhatt

Apart what jonezy used, meta viewport tagas below will also work:

除了 jonezy 使用的内容,meta viewport tag如下所示也可以使用:

<meta name="viewport" content="width=device-width, user-scalable=no">

It will not be scalable and fit to device width - for any device, iOS or Android.

它无法扩展并适合设备宽度 - 适用于任何设备、iOS 或 Android。

Hope it helps!

希望能帮助到你!

回答by nLL

Use mobile doctype:

使用移动文档类型:

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