I have a rectangular image and I would like to crop it into square. It's something like this:
img {
width: 200px;
height: 200px;
}
It works great, but only when I know final width and height. But what I should do when I don't know height value, only width and not in px but in %?
img {
width: 25%;
}
I have only width (25%) and I need square image. What should I do?
I need solution in CSS. I can't use JS.