how to resize image according to div size code example Example: resize img to fit img { max-width:100%; height:auto; }