img {
width: 100%; /* why if I remove the width of 100%, the image takes the full container causing overflow */
height: 100%; /* Need to use it so that image take full height, why? */
aspect-ratio: 16 / 9; /* Is it necessary to use aspect ratio? Is it good practice to use it every time we use images? I know that aspect ratio preserve the dimensions of the image */
object-fit: cover; /* why cover here doesn't take full height? */
display: block; /* Is it important here to set display as block? I know setting display as block on images doesn't leave any "blank" pixels */
}
img {
width: 100%; /* why if I remove the width of 100%, the image takes the full container causing overflow */
height: 100%; /* Need to use it so that image take full height, why? */
aspect-ratio: 16 / 9; /* Is it necessary to use aspect ratio? Is it good practice to use it every time we use images? I know that aspect ratio preserve the dimensions of the image */
object-fit: cover; /* why cover here doesn't take full height? */
display: block; /* Is it important here to set display as block? I know setting display as block on images doesn't leave any "blank" pixels */
}