There are numerous ways to make a div cover the entire screen with a full-screen image in the background. However, most of them involve using min-height:100%
and background-size:cover
properties. This can sometimes cause other sections like the footer or header to "float" above the full-screen div.
For example:
https://i.sstatic.net/6hkEa.png
The left image shows what most solutions currently do, while the right image depicts the ideal scenario.
One solution is to use the vh
units.
Are there any other CSS-only methods that would work across most browsers?
Thank you.
PS - Please excuse my lack of elegance in explaining this to you.