移动端理想视口

移动端界面开发必须设置.

meta标签

理想视口属性

理想视口:
width=device-width 宽度等于设备的宽度
initial-scale=1.0 初始的缩放倍率为1 不缩放
user-scalable=no 用户禁止缩放
maximum-scale=1.0 最大缩放 1
minimum-scale=1.0 最小缩放 1

理想视口代码片段快捷方式

html代码片段

{
    // Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and 
    // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
    // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
    // same ids are connected.
    // Example:
    // "Print to console": {
    //  "prefix": "log",
    //  "body": [
    //      "console.log('$1');",
    //      "$2"
    //  ],
    //  "description": "Log output to console"
    // }
    "生成理想视口": {
        "prefix": "lx",
        "body": [
            "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0, user-scalable=no\">"
        ],
        "description": "生成理想的视口"
    },
}

保存,此后在html页面中输入lx会自动输出已设置好meta标签的理想视口.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容