1:图片等比例放大缩小
<img src="../../assets/login-bg.jpg">
img{
max-width: 200px;
max-height: 200px;
}
2:对图片进行剪切,保留原始比例:
img {
width: 200px;
height: 400px;
object-fit: cover;
}
1:图片等比例放大缩小
<img src="../../assets/login-bg.jpg">
img{
max-width: 200px;
max-height: 200px;
}
2:对图片进行剪切,保留原始比例:
img {
width: 200px;
height: 400px;
object-fit: cover;
}