How to fit child into parent div? | Sololearn: Learn to code for FREE!


How to fit child into parent div?

Suppose we have .parent of height 200px and inside .child of height 400px I want to fit .child into parent from .parent don't want child of height 100%

12/6/2020 1:36:30 AM

Amar Dahake

7 Answers

New Answer


could you please post a code that we can imagine the complete context of your question. it is not clear for us what you want to do.


Amar Dahake Look at this code


Width 100% and height equal to parent div 🤔 Else make your que more clear


丹ⓨㄩک廾 ok check question again


You can use flex box properties of CSS


Yes 丹ⓨㄩک廾


Amar Dahake you can set height of child div as 200%