how to handle an image in html css to fit div code example Example: resize img to fit img { max-width:100%; height:auto; }