简体   繁体   English

如何使浮动div浮动在页面底部

[英]how to make a floating div that will float at the bottom of page

我想制作一个浮动div,它将位于页面底部,如果当前页面的底部位于窗口屏幕上方,否则它将位于窗口屏幕任务栏上方,如果我们滚动页面,它将保持其当前位置。

You need to use position: fixed 你需要使用position: fixed

#footer {
    position: fixed;
    bottom: 0;
    width: 100%;
}

Here's the fiddle: http://jsfiddle.net/uw8f9/ 这是小提琴: http//jsfiddle.net/uw8f9/

try this style for your floating DIV 尝试这种风格的浮动DIV

{
display:block;
position:absolute;
float:left;
bottom:0px;
left:20px;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM