1、现象: 2、解决: 【1】 img{ width: auto; height: auto; max-width: 100%; max-height: 100%; } 【2】 img{ width: 100%; height: 100%; object-fit: contain; } 3、效果: