Vertical scroll in HTML for no reason


Crossposted to http://kiri.dmt-uts.net

body at 100% height

The strangest thing has happened to me lately with HTML, and although clearly others have come across this problem since I appear to have found other threads, I haven't personally found a satisfactory explanation as to why it happens. I'm confused, really, I am - or maybe that's the sleeplessness talking.

The problem is that for some reason if you set height:100% on both the html and body tags this causes vertical scroll bars on the page for no apparent reason, despite having no content on the page, margins set or otherwise.

html,body {
    height:100%;
    width:100%;
}

In any case, there have been responses that DOCTYPE must be declared, which wasn't relevant in this instance, and questions such as 'why would you need to set body to 100% height anyway?' in the usual tact of the internet. Solutions have involved using position:absolute and overflow:hidden neither of which have the intended effect that I desire, and are inadvisable in my opinion.

Probably the most useful comment was that there is margin and padding on the body element which needs to be reset, but considering I had already tried resetting this and it had no effect, this was not helpful.

html,body,form,fieldset {
    margin:0;
    padding:0;
    border:0;
}

It depends on your particular problem, but in this case, I only managed to solve this by leaving html at 100% and setting body to 97% as any larger percentage still left me with vertical scrollbars.

Why did I need html and body at 100% anyway? I wanted a div to be the full height of the screen. All for the sake of my terrible webdesign.