I’m trying to take an image from an external URL and put it in a specifically sized div.
For instance a div that is 300×200. The image at the external URL could be landscape or portrait and I don’t wan’t to have the image cropped with something like overflow:hidden
Is there a good/clever way to do this?
You could try
#your-div img {
max-width: 100%
max-height: 100%;
}
this should do the job for you as in this jsfiddle http://jsfiddle.net/trickeedickee/xWeVK/