![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)
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
![Help, img doesn't auto fit in div container on certain width - HTML & CSS - SitePoint Forums | Web Development & Design Community Help, img doesn't auto fit in div container on certain width - HTML & CSS - SitePoint Forums | Web Development & Design Community](https://global.discourse-cdn.com/sitepoint/original/3X/e/3/e32075225c6b9699afa000b62f8f62a5375370dc.jpeg)
Help, img doesn't auto fit in div container on certain width - HTML & CSS - SitePoint Forums | Web Development & Design Community
![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
![html - Fit Image in DIV as a background which contains height less than division (Different) - Stack Overflow html - Fit Image in DIV as a background which contains height less than division (Different) - Stack Overflow](https://i.stack.imgur.com/hfBzq.png)
html - Fit Image in DIV as a background which contains height less than division (Different) - Stack Overflow
![How to fit an iframe in a div element | iframe with custom width | custom iframe container - YouTube How to fit an iframe in a div element | iframe with custom width | custom iframe container - YouTube](https://i.ytimg.com/vi/voXlG_U3sVc/maxresdefault.jpg)
How to fit an iframe in a div element | iframe with custom width | custom iframe container - YouTube
![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/cVS2Y.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
![html - Fit Image in DIV as a background which contains height less than division (Different) - Stack Overflow html - Fit Image in DIV as a background which contains height less than division (Different) - Stack Overflow](https://i.stack.imgur.com/g63cF.png)