正在使用 Angular 5,我正在尝试在我的代码中导入引导程序,但无法这样做。我已经使用以下方法安装了引导程序:
npm install --save bootstrap
我还将css文件添加到.angular-cli.json中,如下所示:
"styles": ["../node_modules/bootstrap/dist/css/bootstrap.min.css",
"../node_modules/bootstrap/dist/css/bootstrap.css",
"styles.css"
],
但是当我在谷歌浏览器中检查我的代码时,我得到的是这个,
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>MyFirstApp</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
<script type="text/javascript" src="inline.bundle.js"></script><script type="text/javascript" src="polyfills.bundle.js"></script><script type="text/javascript" src="styles.bundle.js"></script><script type="text/javascript" src="vendor.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script>
</body>
</html>
标头部分中没有引导程序的样式。请帮助我。我被困住了
试试这个,将你的风格bootstrap.min.css
添加到style.css
@import "../node_modules/bootstrap/dist/css/bootstrap.min.css";
"./../node_modules/bootstrap/dist/css/bootstrap.css",./../node_modules/bootstrap/dist/css/bootstrap.min.css",
像这样使用相同
将您的样式bootstrap.min.css
添加到 main style.css
:
@import "../src/css/bootstrap.min.css";