I have this fiddle I'm playing with to crop and center an image. It works quite well, but I would need the wrapping div.test
to have the same width of the image
. This is not possible: if I set the width
of the img
to 300px
the magic does not work. I think it's because of the span
I use to center the image. I think it leaves a kind of space footprint
(maybe the space between letters or words?).
So: how to make its space effects "invisibles"?
Update
My original purpose was: resize the image horizontally and crop-and-center vertically + compatibility from IE8 >. All done with CSS. The solution linked above is almost close to the solution, but not perfect (the little space on the left). That's why I asked for a fix on it.