0

I have a little problem. I don't know how to center (img) cards. I've tried many codes and nothing happens.

wnm210
  • 33
  • 1
  • 6
  • Does this answer your question? https://stackoverflow.com/questions/7273338/how-to-vertically-align-an-image-inside-a-div – JLeno46 Nov 20 '20 at 11:12

3 Answers3

2

How do you want to center them? One option is with flex box. give the parent element class of .flex-container and do this:

.flex-container {
  display: flex;
  justify-content: center;
}
Aleksandar
  • 460
  • 3
  • 13
0

The one i use mostly is:


.card-container {
    display: grid;
    place-items: center;
}

This places all the items inside the .card-container in the middle.

gospecomid12
  • 712
  • 3
  • 11
  • 25
0

If you need a centered into your row, Add css like this in <div class="row ...">

.justify-content-center {
-webkit-box-pack: center !important;
    -ms-flex-pack: center !important;
        justify-content: center !important;
}
Adhitya
  • 660
  • 1
  • 4
  • 18