I need to set maximum height and width of a image in <img> tag. For example say max size is 400×400 px so if the image size is smaller than this then it will show the image as it is and if size is bigger then this then it should be compressed to this size. How can I do this in html or javascript?
I need to set maximum height and width of a image in <img> tag.
Share
Set the
max-widthandmax-heightin CSS