0

I am writing app in Angular. I want that cards be displayed sequentially. Now, when the number of cards is less than the full row, the cards move to the right, which looks bad. How can I fix it?

enter image description here



enter image description here

Html file:

<div class="box">
    <div class="row" style="padding-top: 3%; max-width: 2800px;">
        <div *ngFor="let order of orders" class="col mb-5">
            <div class="card text-center bg-white rounded shadow-sm">
                <div class="card-body">
                    <h5 class="card-title">{{orderStatuses[order.status]}}</h5>
                    <p class="card-text small text-muted">{{order._id}}</p>
                    <p class="card-text">Kwota: {{order.sum}} zł</p>

                    <div class="buttons box px-3 py-2 mt-4">
                        <button type="button" class="btn additional effect 
                                 [routerLink]="order._id">
                            <strong>Sprawdź</strong>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

CSS file:

.box {
    display: flex; 
    justify-content: space-around;
  } 
  .card {
  max-width: 325px;
  }
4
  • class="col mb-5" >>class="col-mb-5" Commented Feb 22, 2021 at 13:20
  • Then there are no margins, and the box class that centers the view stops working. Is there any other option to fix this? Commented Feb 22, 2021 at 13:29
  • 2
    Does this answer your question? How to create Bootstrap columns all with same width? Commented Feb 22, 2021 at 13:44
  • Yes, exactly. Thank you :) Commented Feb 22, 2021 at 14:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.