无法在VS代码中链接我的CSS Bootstrap文件

时间:2018-06-30 10:35:38

标签: css angular visual-studio-code bootstrap-4

我无法将我的引导程序文件链接到VS Code中的HTML,因为我已经将其链接了,所以它不起作用。

enter image description here

3 个答案:

答案 0 :(得分:0)

尝试一下

<link href="./bootstrap.css" rel="stylesheet" type="text/css">

答案 1 :(得分:0)

尝试像这样在样式表(CSS / SCSS)中导入

@import '~bootstrap/scss/bootstrap-reboot';

@import '~bootstrap/scss/bootstrap-grid';

答案 2 :(得分:0)

如果这是一个angular-cli项目,并且您想在整个项目中使用引导程序,则正确的方法是通过npm进行安装,例如:

npm install bootstrap --save

,然后确保文件引用位于样式和脚本下的angular-cli.json文件中:

  "styles": [
    "../node_modules/bootstrap/scss/bootstrap.css",
    ....
    ...
    "styles.css"
  ],
  "scripts": [
    "../node_modules/bootstrap/dist/js/bootstrap.bundle.js"
    ....
    ..
  ],