首页 > 代码库 > 手机中如何让图片不把容器撑开?

手机中如何让图片不把容器撑开?

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

?

手机中如何让图片不把容器撑开?