我正在使用皮带和大括号方法,配置所有可用的视口设置,根据developer.android.com的来自 Web 应用程序的目标屏幕
以下语法显示了所有受支持的视口属性以及每个属性接受的一般值类型:
<meta name="viewport"
content="
height = [pixel_value | device-height] ,
width = [pixel_value | device-width ] ,
initial-scale = float_value ,
minimum-scale = float_value ,
maximum-scale = float_value ,
user-scalable = [yes | no] ,
target-densitydpi = [dpi_value |
device-dpi | high-dpi | medium-dpi | low-dpi]
" />
为无缩放配置的元标记:
<meta name="viewport"
content="
height = device-height,
width = device-width,
initial-scale = 1.0,
minimum-scale = 1.0,
maximum-scale = 1.0,
user-scalable = no,
target-densitydpi = device-dpi
" />
作为一个班轮:
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />