Search code examples
cssviewportscaling

viewport scaling works on image width but not height


I can't get this simple slideshow to re-size correctly. When I shrink down the window, the image width compresses, but the height does not, and I want the height/width ratio to remain the same as the viewport shrinks. I know the fault lies somewhere in my CSS, and but I can't track down the issue. Any help appreciated.


Solution

  • Just use height: auto

    .slides img {
      height: auto;
      /* Rest of you code */
    }