img{
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
}
最近做公益项目用到了这个。
根据父容器的自动缩放,并保持图片原来的比例。这样你设置父容器的大小就可以啦。
img{
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
}
最近做公益项目用到了这个。
根据父容器的自动缩放,并保持图片原来的比例。这样你设置父容器的大小就可以啦。