manishkr1608
manishkr1608

Reputation: 323

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

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

Answers (2)

icodebuster
icodebuster

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

San
San

Reputation: 624

try this style for your floating DIV

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

Upvotes: -4

Related Questions