设置html初始值0,html – 什么是initial-scale = 1.0?

通常的移动响应站点将在头部包含HTML元标记,如下所示:

在标记内,width属性控制视口的大小.它可以设置为像width = 400这样的精确像素数,也可以设置为特殊值设备宽度值,它是CSS像素中屏幕宽度的100%. device-width是响应式网站最常用的宽度,可扩展到不同的屏幕尺寸.

首次加载页面时,initial-scale属性控制初始缩放级别,即1个视口像素= 1个CSS像素.用户可扩展,最大规模和最小规模属性控制用户如何缩放或缩小页面.

您可以设置示例html页面并包含viewport标记并更改initial-scale属性以查看差异.还可以尝试在不同的视口大小和方向上查看页面.

initial-scale: The initial zoom when visiting the page. 1.0 does not zoom.

要回答initial-scale = 2.0意味着这里是使用2.0的一个例子:

In addition to the above,you may want to specify the initial zoom factor for the viewing area. If you want to set the viewport of your page to be equal to the device’s width and have it zoom in by default with a factor of 2 for example,this property will come in handy. The code for that would look as follows:.

The Image above shows what this would look like — although it is not a particularly practical demonstration of the possibilities the initial scale setting has to offer,the underlying point should be clear: content is blown up with a factor of 2 upon first load.

你可能感兴趣的:(设置html初始值0)