how to make image take width of parent div code example Example: how to make img cover parent div img { object-fit: cover; }