Gopi Reddy

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromGopi Reddy
ToMe
Subjectjust an observation
Date26 April 2006 02:15
Hello Mark,

I'm a frequent user of your excellent tutorials...  I just have this
observation on document.body.clientWidth/Height.  IE7 (and probably IE6)
seems to return the window dimension even in strict mode if we set the
body width and height to 100%.

<body style="margin:0;-width:100%;height:100%">...</body>

Best,

Gopi
FromMe
ToGopi Reddy
SubjectRe: just an observation
Date26 April 2006 09:55
Gopi,

> IE7 (and probably IE6)
> seems to return the window dimension even in strict mode if we set the
> body width and height to 100%.

They return the width of the document's content. If you force that width to
100%, then they will return that width, yes. Assuming that does not damage
the style of your page, that is ok, but for a reliable effect, you cannot
always assume that style has been set on every page, hence the detect that I
use.

In IE 7, it will probably have that effect. In IE 6, if you have content
that is wider than the body, and overflows, then according to IE's broken
overflow model, it should then report the wrong width (since that will drag
the body wider than the specified width). As for what it will actually do,
that is up to IE ;)


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.