Fullscreen HTML Element using window.innerHeight/Width different with DOCTYPE

Posted by CryptoQuick on Stack Overflow See other posts from Stack Overflow or by CryptoQuick
Published on 2011-01-02T06:47:27Z Indexed on 2011/01/02 6:53 UTC
Read the original article Hit count: 291

Filed under:
|
|
|

I'm trying to make an HTML5 canvas element fullscreen with the window.innerHeight and innerWidth properties.

Unfortunately, on Chrome 10, when I set use the following doctype:

<!DOCTYPE HTML>

...there is some extra scrolling space indicated by scroll bars which shouldn't appear.

Without a doctype, everything is fine.

The element is an HTML5 canvas, so styling with 100% will only stretch the content.

Is it worth using a doctype which breaks my functionality (without which might be bad?), or should I subtract, say, 15px from the values in order to keep scroll bars from appearing? (which is kludgy)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html