Reputation: 323
I want to make a floating div that will sit at the bottom of the page if bottom of current page is above window screen otherwise it will sit just above windows screen taskbar and if we scroll the page it will maintain its current position.
Upvotes: 17
Views: 45675
Reputation: 8964
You need to use position: fixed
#footer {
position: fixed;
bottom: 0;
width: 100%;
}
Here's the fiddle: http://jsfiddle.net/uw8f9/
Upvotes: 41
Reputation: 624
try this style for your floating DIV
{
display:block;
position:absolute;
float:left;
bottom:0px;
left:20px;
}
Upvotes: -4