我在调整图片大小方面遇到了麻烦。您现在看到的大小适合,但它们没有按比例缩放。如果图片太大,你知道怎么裁剪吗?
.post-img {
margin-bottom:20px;
}
.post-img img {
max-width:100%;
height:245px !important;
}
最佳答案
将图像设置为背景。
Background-size: cover;
Background-position: center;
Background-repeat: no-repeat;
关于css - 图像大小相同 - 比例缩放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37301266/