how to make the border to fit the size of image automatically code example Example: border of image take the size of div max-width:100%; max-height:100%;