美文网首页
移动端理想视口

移动端理想视口

作者: 爱吃炸鸡的Banana | 来源:发表于2020-12-02 20:29 被阅读0次

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

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

    相关文章

      网友评论

          本文标题:移动端理想视口

          本文链接:https://www.haomeiwen.com/subject/akkywktx.html