@jen67
Posted
Hi @Rrdesh07,
Your code and card design are well done! To center an image without using flexbox, you can try using the text-align
property on the parent container and set margin: 0 auto;
for the image. This centers the image horizontally within its container. Here's an example:
.card {
text-align: center;
}
img {
max-width: 100%;
display: block;
margin: 0 auto; /* Center the image horizontally */
}
Feel free to give it a try, and let me know if it helps!
Marked as helpful
@Rrdesh07
Posted
@jen67 Hey , Thank you for your suggestion, i was doing it in wrong way because of lack of understanding in shorthand of margin , now i got it where i was going wrong , Thank you :)