I'm trying to create a movies app with similar layout to that of youtube, I used the body as a flex parent and (nav and main) as flex children, I already went through some similar questions in Stackoverflow however none of them solved my problem
here's my code :
```https://codepen.io/userahmad2001/pen/poaKXBz```
2024 Update:
I stumbled upon this randomly going through my profile, and I would actually NOW recommend using dvh
instead of vh
. Specifically with mobile browser chins and forehead UI, they don't count vh
but counts dvh
, so I would now do the following:
body {
min-height: 100dvh;
}
you can check the browser support for it, its good for most people I would say, but < 90% might be worry-some for others. https://caniuse.com/mdn-api_css_dvh_static
Previous Answer:
I believe I understand what you're saying,
(If this is completely wrong let me know an I'll update it!)
you need to add a height to the body, perhaps a min-height would help
body {
min-height: 100vh;
}
this sets the height to be ATLEAST the the height of the viewport.
Take a look, https://codepen.io/looskie-the-flexboxer/pen/abqjOge