I have a square image (for instagram) - 1080x1080 pixels.
I need to center the image and resize the image according with the resolution. If resolution is 1920x1080 - then I have a image with 1080x1080.
If the resolution is 1280x720 - I will have 720x720.
I tried:
img {
display: block;
margin: auto;
width: 50%;
}
Works fine to center the image - but the image doesn't resize correctly.