按父容器宽度自动缩放,并且保持图片原本的长宽比
img{
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
}
按父容器宽度自动缩放,并且保持图片原本的长宽比
img{
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
}
转载于:https://www.cnblogs.com/laneyfu/p/9474368.html