我的图像 div 没有扩展到 height: 100%
时遇到问题。
html
、body
和 wrapper
设置为 height: 100%
。
下面的代码是我目前使用的:
.blogimgcont {
width: 100%;
height: 100%;
}
.blogimgcont img{
height: 100%;
width: 100%;
}
100vh 确实会使图像占据整个垂直高度,但我担心使用它会遇到跨浏览器兼容性问题。
谁能指出为什么 height: 100% 不起作用?
请查看http://protein.guru/澄清
编辑:
我还是决定使用 100vh - 谢谢你的回答
最佳答案
试试这个
.blogimgcont {
width: 100%;
height: 100%;
position: relative;
top: 0;
bottom: 0;
}
关于css - 图像 div 设置为高度 : 100% but not expanding to 100% - trying to avoid 100vh,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34752252/