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
Just leave
out. If it's not given it's "auto" by default...
There is also an IE issue when using images with
height=auto
within flex containers.For me personally, the issue was caused due to the image being placed within nested flex containers. I was able to remove the parent flex container and the issue was resolved for me.
There are a few more work around solutions that people have mentioned in the page below: https://github.com/philipwalton/flexbugs/issues/75
You can do
width="100%"
andmax-width="100px"
or whatever width you want and then simplyheight="auto"
. This worked for me.BTW you may need
min-width
width your wanted width too if your parent element doesn't have the width that you want for your image.The solution was to add the typical IE fix :(
css:
I had the same problem and fixes with min-height and !important didn't work for me. My img was in a flex container. I then tried putting the img inside another, wrapping div and then height:auto worked.