Full height of div element | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

Full height of div element

How to give a div as well as its child div to height 100% that it will cover full height of the browser. Note:- I already gave 100% to both. but it covers only the content part, not the full height of the browser. <div class="parent"> <div id="child">Content goes here</div> </div> what will be its CSS according to my question?

26th Mar 2019, 1:23 PM
DIPTIRANI SAHU
7 Answers
+ 1
I just tried and it's working. Kindly share the link of your code.
26th Mar 2019, 2:37 PM
Шащи Ранжан
Шащи Ранжан - avatar
+ 4
Vasiliy Thanks Man.. It worked 😊.
26th Mar 2019, 5:34 PM
DIPTIRANI SAHU
+ 3
Shashi Ranjan Yes tried..No change
26th Mar 2019, 2:23 PM
DIPTIRANI SAHU
+ 3
DIPTIRANI, You can use this code :- . parent { height: 100vh; width: 100%; } .child { height: 100%; width: 100%; }
19th Jun 2019, 3:32 PM
Anshu Kumari
Anshu Kumari - avatar
+ 2
Diptirani Sahu CSS html, body, div {height: 100%;}
26th Mar 2019, 4:53 PM
Solo
Solo - avatar
+ 1
Did you tried giving an absolute position to parent element? It should work.
26th Mar 2019, 2:01 PM
Шащи Ранжан
Шащи Ранжан - avatar
+ 1
Diptirani Sahu Often the world is much simpler than we think.☺
26th Mar 2019, 7:07 PM
Solo
Solo - avatar