0

I have try to install Bootstrap in Angular 13 with this link: https://www.itsolutionstuff.com/post/how-to-install-bootstrap-5-in-angular-13example.html

However, as i update bootstrap to v5 it does not work, all the styles are wrong. On the other hand, it works properly with bootstrap 4.6.1.

I have do the same as this link. Is there another thing that is supose to be done?

Naomi
  • 37
  • 5

4 Answers4

0

my recommendation would be to go to https://getbootstrap.com/ and follow the installation instructions on their website. it has the newest version of bootstrap 5 on it and it gives you links and scripts to input straight into your html page.

Dathon Weber
  • 53
  • 2
  • 8
0

Normally it's hard to try to import styles only by npm install, you'll find that it's much easier to use a CDN instead in most cases.

So what I would suggest you is make npm uninstall of any bootstrap package you have listed in your dependencies at package.json, then go to index.html of your angular project and under the default <link>s paste the cdn:

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

Now your project should have bootstrap 5.

Saul Martinez
  • 114
  • 11
  • But if i have no internet will this package work? – Naomi May 24 '22 at 18:14
  • It will not. I assume something you could do is npm install bootstrap, then instead of the https link I pasted there, put a path to the installation in your node_modules folder (it should look like ```"node_modules/bootstrap/dist/css/bootstrap.min.css"```). Or, you could go to your ```style.css``` file and paste the import (something like ```@import "~bootstrap/dist/css/bootstrap.css";```) . – Saul Martinez May 25 '22 at 00:20
0

My issue was that some class names has change from boostrap 4 to boostrap 5. I leave here a link if someone has the same problem:

Bootstrap 5 navbar align items right

On the other hand, i installed this library instead boostrap as it has all dependencies and i find it easier

https://ng-bootstrap.github.io/#/home

Naomi
  • 37
  • 5
0

Its Very Simple you can down my 2 Step into Angular.

If you are a new beginner into Angular Please visit my blog on that i have made a Detail content on that page.

Please Visit :- https://ngangulardetails.blogspot.com/p/how-to-install-bootstrap-5-or-latest.html.

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/32691712) – user16217248 Sep 18 '22 at 04:27