viewport理想视口
-
布局视口宽度 = 视觉视口宽度 = 设备宽度( = 内容宽度)
比默认的多这些代码:
<meta name="viewport" content="width=device-width, initial-scale=1.0 "/>;
步骤
点击设置——》用户代码片段
选择新建全局代码片段文件:
输入新建代码片的名字:
把默认生成的示例代码删掉:
复制新的代码,如下,保存:
就好了
{
此处html就相当与快捷指令:可更改
"html": {
"prefix": "html",
"body": [
"<!DOCTYPE html>",
"<html>\n",
"<head>",
"\t<meta charset=\"UTF-8\">",
"\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\">",
"\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
"\t<title>Document</title>",
"\t<link rel=\"stylesheet\" href=\"$1\">",
"\t<script src=\"$2\"></script>",
"</head>\n",
"<body>\n$3",
"</body>\n",
"</html>"
],
"description": "The full sample code - html5."
}
}