Using max-width = 100% and max-height = 100% on an image, calculate the display width/height
- by NatalieMac
I am creating a slideshow for images of various sizes to display centered vertically and horizontally within a canvas area.
In my CSS, I set the width and height of the image to 100% so that each image would proportionally fill the canvas. I want the canvas to auto-size itself to fit within the viewer's screensize as the original size of the…