Complete the code to make the image cover its container fully.
img {
width: 100%;
height: 200px;
object-fit: [1];
}The cover value makes the image fill the container while keeping its aspect ratio, cropping if needed.
Complete the code to make the image fit inside the container without cropping.
img {
width: 300px;
height: 150px;
object-fit: [1];
}The contain value scales the image to fit inside the container without cropping, preserving aspect ratio.
Fix the error in the code to properly scale down the image if it is larger than the container.
img {
width: 400px;
height: 300px;
object-fit: [1];
}The scale-down value scales the image down to fit inside the container only if it is larger, otherwise it keeps original size.
Fill both blanks to make the image stretch to fill the container, ignoring aspect ratio.
img {
width: 250px;
height: 250px;
object-fit: [1];
object-position: [2];
}fill stretches the image to fill the container ignoring aspect ratio.center centers the image inside the container.
Fill all three blanks to create a responsive image that covers the container and aligns to the top right.
img {
width: 100%;
height: 300px;
object-fit: [1];
object-position: [2] [3];
}cover makes the image fill the container while keeping aspect ratio.top right aligns the image to the top right corner.