Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个图像查看器,由于某种原因,图像无法缩放到页面(我正在使用:)height: 82%, width: auto。你可以在我的网站上看到这个问题,guyzyl.org。转到画廊并输入照片以查看问题。任何帮助表示赞赏!
height: 82%, width: auto
尝试将其设置为
#viewer img { max-height: 82%; max-width: 100%; }
这应该可以达到您想要的结果。
用于. display:block _img
display:block
img
此外,当您使用子容器auto的宽度和高度时,父容器应该具有指定的尺寸。
auto