Behrooz
Tahanzadeh


Contain an image within parent element

If you want to size an image proportionally to completely contained in its parent element just use max-width and max-height properties.


[btcode title=”css” lang=”css”]/*your image selector*/
img
{
max-width : 100%;
max-height : 100%;
}
[/btcode]