How to vertically align image inside a div like I do with margin auto?
تبليغيرجى شرح بإيجاز لمإذا تشعر أنك ينبغي الإبلاغ عن هذا السؤال.
I have this card I am trying to make, that has an image container, and inside the image.
With the display: block on the image which you can see below, I am able to get an even space on the left and right side for the image.
I was wondering how I vertically align the image, similar to margin: auto so that from top and bottom i also get the space evenly distributed to center the image?
.img-container {
border: 1px solid black;
width: 170px;
margin: auto;
border-radius: 10px;
height: 180px;
}
.card img {
max-width: 130px;
display: block;
margin: auto;
}
أضف إجابة