Is there a way to make the CSS margin: top;
on my HTML main_content
element relative to the browser window? I want the main_content
to always stay at the bottom of the browser window. How can I achieve this?
I attempted the following code, but it didn't work as expected. The body {height:100vh}
does not seem to give the body
any height, causing the main_content
element to not stick to the bottom.
body {height:100vh}
#main_content {position:absolute; width:100%; display:block; left:0; bottom:0; text-align:center; padding:20px;}
<div>Extra Infomation </div>
<div id="main_content">
<p>here you can learn about me and my adventures</p>
</div>
Please note that if you visit my website at www.jeffarries.com, you will see the "learn about me and my adventures" heading along with other content at the bottom of the browser window. I would like this section to be positioned at the bottom, preferably with the "learn about me and my adventures" part slightly sticking out from the bottom of the page.