Hi, I've read that clientheight is read only so I'm wondering if you can style the div within the 'client' to match it's height and width properties so that no scrollbars appear when the screen is smaller.

One thing to keep in mind, no matter what technique you end up using, is that if there is too much content to fit on someone's screen they will not be able to get to it without scrollbars. (i.e. if they have their browser maximised and your content it still to long to fit on their screen, and you're hiding the scrollbars by setting "overflow:hidden;" they will not have access to all the content.)

The last part will give you a small area that contains your content. If you would change "overflow:hidden;" to "overflow:auto;" on #div1 you would end up with a small scrollable area in the middle of the page.

Hope this helps.

Heinz_Stapff
—
2011-08-26T07:03:58Z —
#3

AussieJohn Thanks for the responce. I guess the answer to my question was a no. You can't even use the attribute height of one element and pass it off to a variable y lets say and then use it on another element, forget the fact that the elements attribute would have to be written in the html tag itself IE8 won't list all the attributes anyway.

<div id="dog" class="animal" width="100%" height="50%">dog</div>

Width and Height attributes return null and the length of dog . attribute . length returns 3 as the browser generates a name= attribute equal to the id. I was acctually amazed that it reported the class attribute.

The problem I was trying to overcome was the IE8 99.5% WIDTH of div within a div especialy those that have scrollbars or inner divs that have borders etc.

AussieJohn
—
2011-08-26T10:04:25Z —
#4

One thing to note is that <div>'s do not have a width and height attribute (in fact, most HTML elements do not have a direct width/height), which is why you can't access those directly.If you want to access the width or height of a HTML element you'll need to generally use the style property, e.g.