How to position a div at the bottom of the viewport in standard and in quirks mode ??

Posted by Gonzalo on Stack Overflow See other posts from Stack Overflow or by Gonzalo
Published on 2010-05-31T18:02:13Z Indexed on 2010/05/31 22:23 UTC
Read the original article Hit count: 267

Filed under:
|
|
|

Hi, I need to position a div to the bottom of my viewport. I start using position:fixed; bottom:0px; and that work just fine. But the thing that I'm working on gets injected via javascript in different pages. And some of the pages doesn't have a doctype defined, so in IE gets rendered like quircks mode, so the div doesn't get positioned correctly..
I've tried to position the div using javascript (document.documentElement.clientHeight) and that works fine. But when no doctype is defined, the "document.documentElement.clientHeight" is 0, so again the div doesn't get positioned correctly. Any idea on how to fix this problem? I'm only interested in IE 7 and 8.

Thanks in advance Gonzalo

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about position