IE8 non-compatibility mode, image with max-width and height:auto

后端 未结 6 1039
清酒与你
清酒与你 2020-12-24 06:22

I have an image with this markup


And I am using CSS to downsize it to 600

6条回答
  •  太阳男子
    2020-12-24 06:38

    Wow, saved me a lot of time there!

    i had a similar problem with an image in position: absolute where width was magically taking max-width value. Its weird because it doesn't do that when the image wasn't in position: absolute.

    width: auto; 
    max-width: 200px; 
    height: auto; 
    max-height: 200px;
    

    works great in IE8!

提交回复
热议问题