I have a line of text in a <div> followed by a block
canvas. I want to size the canvas so it fills the rest of the
window below the line of text. If I set the canvas's CSS height to
100% the canvas is given a size equal to the window size less the
body's margin, border and padding. Therefore the combination of
the line of text and the canvas is too big for the window. A
scrollbar appears and the bottom part of my canvas is cut off.
To size the canvas myself, I need to do something like the
canvasHeight = window.innerHeight - body margin height * 2 - body
padding height * 2 ;
canvasHeight -= body border height * 2;
canvasHeight -= text label height; (including any margin on the text);
clientHeight gives me the content area height + padding.
offsetHeight gives me clientHeight + border. So I can see how to
get the border height but not how to get margin and padding
begin:vcard fn:Mark Callow n:Callow;Mark org:HI Corporation;Graphics Lab, Research & Development adr:Higashiyama 1-4-4, Meguro-ku;;Meguro Higashiyama Bldg 5F;Tokyo;;153-0043;Japan email;internet:email@example.com title:Chief Architect tel;work:+81 3 3710 9367 x228 tel;fax:+81 3 5773 8660 x-mozilla-html:TRUE url:http://www.hicorp.co.jp, http://www.mascotcapsule.com version:2.1 end:vcard