I am currently enhancing the appearance of my application using Bootstrap,
My current goal is to center a "card" provided by Bootstrap.
I discovered that I can achieve this with mx-auto.
The code I implemented with mx-auto works perfectly in JSFiddle.
<div class="card text-white bg-info mx-auto" style="max-width: 18rem;">
<div class="card-header">Header</div>
<div class="card-body">
<h5 class="card-title">Info card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
</div>
</div>
However, in my actual application, the card is not centered. Can anyone suggest why this might be happening?
The Bootstrap version integrated into my Angular project is 4.1.2
This is how I added Bootstrap to my Angular project:
- npm install bootstrap --save
- npm install jquery --save
- npm install popper.js --save
Then, I included the following in my angular.json file:
"./node_modules/bootstrap/dist/css/bootstrap.css" in the styles section
"./node_modules/jquery/dist/jquery.min.js" in the scripts section
"./node_modules/popper.js/dist/umd/popper.min.js" in the scripts section
"./node_modules/bootstrap/dist/js/bootstrap.min.js" in the scripts section