角度4:如何包含Bootstrap? [英] Angular 4: How to include Bootstrap?

查看:75
本文介绍了角度4:如何包含Bootstrap?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个后端开发人员,我只是在玩Angular4.所以我做了这个安装教程: https://www.youtube.com/watch?v=cdlbFEsAGXo .

I'm a backend developer and I'm just playing around with Angular4. So I did this installation tutorial: https://www.youtube.com/watch?v=cdlbFEsAGXo.

鉴于此,我如何向应用程序添加引导程序,以便可以使用类"container-fluid"或"col-md-6"之类的东西?

Given this, how can I add bootstrap to the app so I could use the class "container-fluid" or "col-md-6" and stuff like that?

推荐答案

npm install --save bootstrap

然后,在angular-cli.json(位于项目的根文件夹中)中,找到styles并添加如下所示的bootstrap css文件:

afterwards, inside angular-cli.json (inside the project's root folder), find styles and add the bootstrap css file like this:

"styles": [
   "../node_modules/bootstrap/dist/css/bootstrap.min.css",
   "styles.css"
],

更新:
角度6+中的angular-cli.json 已更改angular.json.

UPDATE:
in angular 6+ angular-cli.json was changed to angular.json.

这篇关于角度4:如何包含Bootstrap?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆