How to preserve aspect ratio when scaling image using one (CSS) dimension in IE6?

前端 未结 4 1120
一个人的身影
一个人的身影 2020-11-30 19:35

Here\'s the problem. I have an image:

\"alttext\"

Note no height or width specified.

On certa

4条回答
  •  失恋的感觉
    2020-11-30 19:57

    Adam Luter gave me the idea for this, but it actually turned out to be really simple:

    img {
      width:  75px;
      height: auto;
    }
    

    IE6 now scales the image fine and this seems to be what all the other browsers use by default.

    Thanks for both the answers though!

提交回复
热议问题