![html - Stretch half an image to fit in a div and half overflow in mobile and half image display in half portion of div in desktop? - Stack Overflow html - Stretch half an image to fit in a div and half overflow in mobile and half image display in half portion of div in desktop? - Stack Overflow](https://i.stack.imgur.com/cJBS2.png)
html - Stretch half an image to fit in a div and half overflow in mobile and half image display in half portion of div in desktop? - Stack Overflow
![Simple CSS Solutions: How to fit images with different dimensions in set containers | by Kimberly Luu | Medium Simple CSS Solutions: How to fit images with different dimensions in set containers | by Kimberly Luu | Medium](https://miro.medium.com/v2/resize:fit:394/0*EPYBPF6dVduFEMTJ.png)
Simple CSS Solutions: How to fit images with different dimensions in set containers | by Kimberly Luu | Medium
![How to make an image fit proportionally in flexbox item or in sections - HTML & CSS - SitePoint Forums | Web Development & Design Community How to make an image fit proportionally in flexbox item or in sections - HTML & CSS - SitePoint Forums | Web Development & Design Community](https://global.discourse-cdn.com/sitepoint/original/3X/b/d/bd24b7de3c873378f52f80416a0b8701e3872805.png)
How to make an image fit proportionally in flexbox item or in sections - HTML & CSS - SitePoint Forums | Web Development & Design Community
![CSS object-fit and object-position properties: Crop images embedded in HTML | by Martin Michálek | CSS Mine | Medium CSS object-fit and object-position properties: Crop images embedded in HTML | by Martin Michálek | CSS Mine | Medium](https://miro.medium.com/v2/resize:fit:1200/0*qFaAayKdfZgT2Rpy.png)
CSS object-fit and object-position properties: Crop images embedded in HTML | by Martin Michálek | CSS Mine | Medium
![So I want the parent div to have enough height to fit the child div(as shown in the snapshot). Worthy to not I used position: relative and edited the child div's positions So I want the parent div to have enough height to fit the child div(as shown in the snapshot). Worthy to not I used position: relative and edited the child div's positions](https://preview.redd.it/qbvo5ae362i91.png?auto=webp&s=633ab4010a318bf3c04b2b72bd790f9673d51f3a)