Make an image to fit its parent dimensions
I might be naive, but isn't this as simple as this ?
img {
width:100%;
height:100%;
}
The css property that you want is max-width
:
Css
img {
max-width:100%;
}
You could add a container around your image and set overflow:hidden
to prevent images to get bigger than the defined width/height.
Use this bit of css to scale your image:
img {
max-width: 100%;
max-height: 100%;
}