Home > Article > Web Front-end > CSS object-fit property value
#The object-fit property in CSS is used to resize an image or video to fit its container. It has the following values
Live Demonstration
<!DOCTYPE html> <html> <head> <style> .myimg { width:250px; height:350px; object-fit:fill; } </style> </head> <body> <h2>SWIFT</h2> <img class = "myimg" src = "https://www.tutorialspoint.com/assets/videos/courses/67/images/course_67_image.png" alt = "Python Data Science" width = "300" height = "200"> </body> </html>p>
The above is the detailed content of CSS object-fit property value. For more information, please follow other related articles on the PHP Chinese website!