移动端理想视口

2020-12-02  本文已影响0人  爱吃炸鸡的Banana

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

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标签的理想视口.

上一篇下一篇

猜你喜欢

热点阅读