vscode如何設置html模板


文件->首選項->用戶片段;搜索html.json;以下是一個標准的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 index": {
        "prefix": "index", //模板的快捷鍵
        "body": [
            "<!DOCTYPE html>",
            "<html lang=\"en\">",
            "\t<head>",
            "\t\t<meta charset=\"UTF-8\">",
            "\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\">",
            "\t\t<title>Document</title>",
            "\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"\" />",
            "\t</head>",
            "\t<style type=\"text/css\"></style>",
            "\t<body>\n",
            "\t</body>",
            "\t<script src=\"\" type=\"text/javascript\" charset=\"utf-8\"></script>",
            "</html>"
        ],
        "description": "HT-H5" //模板的描述 
    }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM