在这个 fiddle 中调整窗口大小时 https://jsfiddle.net/kaljak/fuzxqkmz/4/调整图像(其容器)的大小,并根据该图像重新缩放。
调整大小由 Css-element-queries ( https://github.com/marcj/css-element-queries )
DIV[max-width~="669px"] {
height: 10.7em;
left: 14.6em;
}
仅在 Chrome 中图像未正确缩放。有谁知道如何解决这个问题? width: auto
和 height: auto
无法删除。
最佳答案
据我了解,您希望 img
具有父级 div
的高度和自动计算的宽度。
所以给 img
一个 100%
的高度。
https://jsfiddle.net/9pmLk0ft/1/
IMG {
margin-left: 1.2em;
width: auto;
height: 100%;
max-height: 100%;
}
DIV {
left: 20.6em;
height: 21.4em;
}
DIV[max-width~="669px"] {
height: 10.7em;
left: 14.6em;
}
关于javascript - Chrome 使用 Css-element-queries 缩放图像错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41440106/