-2

I'm making a website, and I have a nav bar and a main content section, the nav bar is at the top of the screen and the main content in near the bottom of the screen. However, if I change my screen height, the main content section stays in the same place, and it goes out of my browsers viewport/window and disappears, which is perfectly normal and expected. But what I want is for the main content section to always be at the same place at the bottom of the screen, no matter what the screen size/resolution/height is. How can I accomplish this?

My website is jeffarries.com and what I'm talking about is on my home page, if you need a visual.

I've used JavaScript, and I'm not very familiar with it. I have no experience with jQuery, however I'm fine implementing a finished jQuery script.

Thanks for your Time and Energy!

Please let me know if any further information in needed.


UPDATE: Since this question appears to be unclear, take a visit to my website, you will see the text that says "here you can learn about me and my adventures", I want that text to appear at the bottom of the browser window when loaded, however, I want it to remain in usual flow, being on top of the "recent activity" box. Basically I want the margin on top of the text to change based on the browser window height, keeping the text at the bottom of the browser window.

Emmet Arries
  • 539
  • 2
  • 12
  • 35

2 Answers2

1

You can use archive this via CSS3 VH property [ View Port Height ]. For that you have to make one container and add its height to 100vh. Here is the live demo - https://jsfiddle.net/8dptzvye/

*{box-sizing:border-box; -webkit-box-sizing:border-box;}
.container{height:100vh}
.container span{position:absolute; width:100%; display:block; left:0; bottom:0; text-aling:center; padding:20px; background:black; color:#fff}

<div class="container">
<div class="cover">Extra Infomation </div>
<span>here you can learn about me and my adventures</span>
</div>
0

You may be looking for position: fixed

EDIT

If you want to change the margin based on the window size, you can use jquery's resize

$(window).resize(function () { /* change margin of element */ });
vinit
  • 155
  • 14