My goal is to create a straightforward landing page that includes a header, footer, and an image perfectly centered between the two (both horizontally and vertically).
The space above and below the image should be equal and adjust based on the height of the browser window.
The image will have a set width (900px) and height (600px).
Note: The footer will be sticky.
I attempted the following CSS:
{display:block; padding:0 40px; width:900px; margin:0 auto; vertical-align:middle;}
This is how I structured my HTML:
<div class="fbg">
<div class="fbg_resize">
<img src="images/image.png" width="900" alt="" />
</div>
</div>
To center the image horizontally, I used this CSS:
.fbg_resize { margin:0 auto; padding:0 40px; width:900px;}
Here is the important code snippet: