I am trying to resize an img with a percentage of itself. For example, I just want to shrink the image by half by resizing it to 50%. But applying width: 50%; w
I think you are right, it's just not possible with pure CSS as far as I know (not cross-browser I mean).
Edit:
Ok I didn't like my answer very much so I puzzled a little. I might have found an interesting idea which could help out.. maybe it IS possible after all (although not the prettiest thing ever):
Edit: Tested and working in Chrome, FF and IE 8&9. . It doesn't work in IE7.
jsFiddle example here
html:
css:
#img_wrap {
display: inline-block;
position:relative;
}
#rescaled_img_wrap {
width: 50%;
}
#original_img {
display: none;
}
#rescaled_img {
width: 100%;
height: 100%;
}