95% DIV at top of page

C

Csaba2000

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.

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

Csaba2000

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


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
 
E

Els

Csaba2000 said:
<body style="margin:0;height:100%;padding:0">
<div style="height:95%;border:solid 1px blue">foo</div>
bar<br>
baz<br>
frob<br>
fubar
</body>


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

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..)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,079
Messages
2,570,574
Members
47,206
Latest member
Zenden

Latest Threads

Top