95% DIV at top of page

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
What is a good way for me to place a DIV element at the start
of the document so that its width is that of the browser and
its height is 95% of the browser window.

I'll have stuff below the DIV, but the motivation is that I
want to fill out the DIV with a few elements.

Csaba Gabor from New York
(javascript is acceptible - this is for a private site)

Re: 95% DIV at top of page

<body style="margin:0;height:100%;padding:0">
<div style="height:95%;border:solid 1px blue">foo</div>

margin:0 is needed for IE 5.5 and NN 6.1
height:100% and padding:0 are needed by Opera 7.01

Csaba Gabor

Re: 95% DIV at top of page

Csaba2000 wrote:

Quoted text here. Click to load it

Is this the answer to the question, or is it part of the
question? To make the div as wide as the browser window, I'd
say width:100% would be a way to do it.

(or maybe there are more than just two messages in this
thread that I don't see yet..)


Mente humana é como pára-quedas; funciona melhor aberta.

Site Timeline