Is it possible to resize, crop and center an image using only HTML/CSS? (Using the img tag or CSS sprite)
For instance, if I have a 500x500 pixel image,
I would like to resize it to a 250x250 pixel image
To make the actual visible image 100x100 pixels but maintain the scale of a 250x250 sized image.
I want the center of the image to be located at coordinates x,y.
If this is not achievable with solely HTML/CSS, how would you suggest approaching it with JavaScript?
Edit - 動靜能量:
Regarding point (2), assuming my scaled image is now 200x200 and I desire my visible image to be 100x100: Essentially, what I am trying to convey is that I wish for the scale and resolution of the image to remain at 200x200 while positioning the visible image at 100x100. In other words, the visible image should occupy coordinates x,y: 0,0; 0,100; 100,0; 100,100; within the 200x200 image. Apologies for any confusion in my explanation.