I'm having some weird behaviour with chrome regarding image resizing when the window is resized.
When Chrome is snapped fullscreen in Windows(double click the window to snap full screen), and I unsnap the window, causing it to revert to whatever previous size it was unsnapped, images are not being scaled properly.
For example, I have the following css code that resizes images to 100% height of the space available, and auto's the width:
img{
height: 100%
width: auto;
}
When the window is snapped fullscreen it looks fine, the aspect ratio's of the images are kept. But now if I unsnap the window (double click). The height will resize, the width will not, like below:
Whereas in Internet Explorer, unsnapping looks like this:
Anyone know why chrome is not resizing properly? Or is there something wrong with my css?
If you need more code please ask.
Thanks.
Use instead width:100% -> max-width:100%;
I had before this issue once, and I have used both properties of size
img{
max-width:100%;
max-height:100%;
}
It works for me just fine, and save the proportion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With