<!DOCTYPE html> <html> <head> <style> img { width:200px; height:400px; object-fit:cover; } </style> </head> <body> <h1>object-fit 属性</h1> <img src="/static/demo/images/tulip.jpg" alt="Tulip" width="300" height="300"> </body> </html>