DEV Community

Discussion on: CSS gotcha: How to fill page with a div?

Collapse
 
angelsixuk profile image
Luke Malpass

Yes that only works on items at the top for heros. It doesn't allow you to use it mid-page.

It's a well konwn issue. I solved it just using JavaScript on load to set the height and add data-vh="100" where you can pass in a percentage of the view height then it sets it to pixels after load. I will enhance it to detect resizing from address bar hiding (perhaps if resize happens at same time as scroll) vs normal resizing and sort it that way.