位置绝对和底部0
问题描述:
http://cdpn.io/FykHr
我似乎有一个问题, CSS属性:
http://cdpn.io/FykHr I seem to have an issue with the combined CSS properties:
position: absolute;
bottom: 0;
首先,您可以看到.footer div不是在底部。现在,将 font-size
从 120px
更改为 50px
并且div似乎正在按照我的方式工作。
First you can see that the .footer div doesn't isn't at the bottom. Now, change the font-size
from 120px
to 50px
and the div seems to be working the way I inteded it to.
如何让.footer div留在底部(不固定在屏幕底部)。
How do I make the .footer div stay at the bottom (not fixed at the bottom of the screen) regardless of the size of the .content div.
答
您需要添加 position:relative; c。
这是一个父容器良好的参考绝对定位页面。
Here's a good reference page on absolute positioning.