Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

positioning a box to bottom of the page

Status
Not open for further replies.

davikokar

Technical User
May 13, 2004
523
IT
Hallo,
I'm using a javascript to hide and show a div box. The link that shows (onclick) the box is on the bottom of the page. I would like the box to be shown also on the bottom of page, but I'm having trouble with the positioning. I use this code to position the div:
Code:
div#div_credits {position:absolute;
             left:250px;
             bottom:20px;
             width:250px;
             background-color:#F7F8FC;}
it works fine in IE because it positions the box always 20px from the bottompage, considering that the page can be longer than what it is shown in the screen. The behavior of Netscape is probably more coherent because it always place the box exactly in the same position (absolute) without considering the height of the page. So if the page is longer than the screen the box will result in the middle of the page.
Do you know how to place a box 20 px from the bottom of the page?

thanks for helping
 
Make sure that the container where the page is is absolutely or relatively positioned. If it is a regular flow document just add position: relative; to it and it should work. The way absolute positioning works is that it positions element according to the first positioned parent. If none, then window is used. IE experiments in its own way, but will behave properly with proper code. I guess you don't have the parent (the page) positioned, thus Netscape uses window as reference, while IE assumes that you wanted to position it according to the page. With positioning, it should work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top