How to place div at bottom of screen?

2016-09-22 9:50 pm
I want to place my div at the bottom of the screen, so that a certain piece of text is always visible no matter what resolution you have, I don't know what to do and I feel like I'm out of options.

Here's an illustration of what I want to achieve: http://imgur.com/a/1HG59

I also have a parallax-effect in my page so I want the user to scroll down to not only see the rest of the text but to see the parallax too.

回答 (2)

2016-09-22 11:07 pm
✔ 最佳答案
you need to add a class to the div, and set it to a relative position to the bottom in your CSS:
.footer { position: relative; bottom: 0; }
2016-09-22 10:30 pm
A page full of intersting stuff!

<div style="background-color: green; color: white; width: 100%; position: fixed; bottom: 0px; left: 0px;">Some Other Text</div>


收錄日期: 2021-04-21 23:26:42
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20160922135052AAv3DLG

檢視 Wayback Machine 備份