I need to always crop a random-sized image to a square 160x160 using only CSS. The images should stay centered when cropped.
My markup should be:
<
div { width: 200px; height: 200px; overflow: hidden; margin: 10px; position: relative; } .crop { position: absolute; left: -100%; right: -100%; top: -100%; bottom: -100%; margin: auto; height: auto; width: auto; }
http://jsfiddle.net/J7a5R/56/