If the max-width property is set to 100%, the image will scale down if it has to, but never scale up to be larger than its original size:
img {
max-width: 100%;
height: auto;
}
来自: https://www.w3schools.com/css/css_rwd_images.asp
If the max-width property is set to 100%, the image will scale down if it has to, but never scale up to be larger than its original size:
img {
max-width: 100%;
height: auto;
}
来自: https://www.w3schools.com/css/css_rwd_images.asp