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

+1

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% https://code.sololearn.com/WemyCVCeOZZf/?ref=app

12/6/2020 1:36:30 AM

Amar Dahake

7 Answers

New Answer

+5

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.

+4

Amar Dahake Look at this code https://code.sololearn.com/WUZiIaz4kR3o/?ref=app

+2

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

+2

丹ⓨㄩک廾 ok check question again

+2

You can use flex box properties of CSS

+2

Yes 丹ⓨㄩک廾

0

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