If I have:
#logo {
width: 400px;
height: 200px;
}
then
CSS3 object-fit
Am not sure how far its been implemented by webkit, IE and firefox. But Opera works like magic
object-fitworks with SVG content, but the same effect can also be achieved by setting thepreserveAspectRatio=""attribute in the SVG itself.
img {
height: 100px;
width: 100px;
-o-object-fit: contain;
}
Chris Mills demo's it here http://dev.opera.com/articles/view/css3-object-fit-object-position/