how to make an image height same as width css code example
Example 1: make images same size css
img {
float: left;
width: 100px;
height: 100px;
object-fit: cover;
}
Example 2: equal height and width image css
.container {
position: relative;
width: 37%;
}
.container:after {
content: "";
display: block;
padding-bottom: 100%;
}
.container img {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
//Credit for the great answer of "Amaury Hanser", on stackoverflow:
//https://stackoverflow.com/questions/51447317/image-height-same-as-width