VS代码中的Bootstrap(HTML)类建议

时间:2015-11-04 15:43:30

标签: html css twitter-bootstrap-3 autocomplete visual-studio-code

我试图从Visual Studion Pro 2013过渡到Visual Studio Code。似乎Code并没有按照VS 2013的方式提出HTML类建议。我错过了配置选项吗?我在选项中搜索了bootstrap,却一无所获。

enter image description here

    

<head>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ=="
    crossorigin="anonymous">

    <!-- Optional theme -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css" integrity="sha384-aUGj/X2zp5rLCbBxumKTCw2Z50WgIr1vs/PFN4praOTvYXWlVyh2UtNUU0KAUhAX"
    crossorigin="anonymous">

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ=="
    crossorigin="anonymous"></script>
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

<body>
    <h1>Hello, world!</h1>
    <span class=""
</body>

</html>

1 个答案:

答案 0 :(得分:0)

简而言之:
1.在vscode中安装HTML CSS Support Extension。即:ext install vscode-html-css
2.在resource.json或项目根文件夹中添加.vscode文件,您可以配置使用的样式表的路径。
3.将以下代码添加到resource.json文件中。

{
  "css": {
    "style": [

      "replace_with_path_to_your_css_bootstrap_file" //i.e bower_components/bootstrap/dist/bootstrap.css
    ]
  }
}

保存&amp;
完成!
致谢: dwonisch