Home > Back-end >  Different html body height for virtually same React code
Different html body height for virtually same React code

Time:02-04

I tried to replicate the enter image description here

CodePudding user response:

height: 100% requires a parent element to reference for height. I'm actually more surprised that the first example goes to full height.

Either way, adding height: 100vh; to your <div id="root"> element (ie. parent element) will give you full height. Optionally, you could add it to the element that's currently set to height: 100%.

  • Related