I need help making images of different sizes appear as squares in a preview on my webpage.
/* This is the CSS code which sets automatic height: */
.preview-img {
width: 100%;
height: auto;
object-fit: cover;
}
How can I adjust the image height based on its width without specifying pixels?