I have some images with height=auto because sometimes they are different heights whereas they are always the same width. It works in every browser but I.E., is there something similar I can use?
相关问题
- Views base64 encoded blob in HTML with PHP
- How to get the background from multiple images by
- Adding a timeout to a render function in ReactJS
-
Why does the box-shadow property not apply to a
- Add animation to jQuery function Interval
I found that adding
min-height:1px
solves the issue. Not sure why, but, worked for me.i've tried all the solutions posted, and the only one that works is
In "IE9 compatibility view - IE7 Standard Document mode" leaving off height=auto may not solve the problem. Try adding conditional CSS and in your special css file for IE ("ie.css") add a line that assigns the appropriate min-height to your affected class/element.
for example:
.IE7 .[css element] {min-height: xxxpx;}
Where xxx equals the necessary image height.
Use height: auto together with width: auto and it is going to work in IE. If you specify only one of them, IE gets upset.
For Edge browser you can use max-height, which will also work for other browsers
height: initial; will work instead of using height: auto; in chrome and ie.