Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

div in bottom of window, not page

I want a div element, in a bottom of window. like a div in bottom page of old facebook.com. or like a chat div of initial facebook.com

like image 231
loviji Avatar asked Mar 03 '10 13:03

loviji


2 Answers

Try using this. The bottom bar here is made with a div element. I would imagine you can use any element you wish, just reference the CSS class. I have only tested the div element

/* HTML */
<div class='always-at-bottom'>Always at bottom!</div>

/* CSS */
.always-at-bottom {
    height:40px;
    position: fixed;
    left: 0;
    bottom: 0%;
    width: 100%;
    background-color: blue;
}
like image 173
TheMiddleMan Avatar answered Oct 16 '22 05:10

TheMiddleMan


You can use position: fixed; bottom: 0px. But won't work in IE6.

<style type="text/css">
    #footer { position: fixed; bottom: 0px; }
</style>

<div id="footer">I am at the bottom of the window</div>
like image 30
rahul Avatar answered Oct 16 '22 05:10

rahul