Home > database >  Install Bootstrap 5 with angular 13
Install Bootstrap 5 with angular 13

Time:05-25

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?

CodePudding user response:

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.

CodePudding user response:

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/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">

Now your project should have bootstrap 5.

  • Related