PDA

Click to See Complete Forum and Search --> : (HTML & CSS) Why wont my div display 100%? **Resolved**


msimmons
Oct 18th, 2002, 01:44 PM
Why wont my div display 100%?

<DIV id="mainContent7" style="POSITION: absolute; Z-INDEX: 1; LEFT: 2mm; TOP: 39mm; WIDTH: 260mm; HEIGHT:120mm;">
<Form id="formName" name="formName">
<div id="divName" name="divName" style="height:100%; width:100%; color:red;">
<SELECT Name=selName style="WIDTH: 225px;"><OPTION VALUE="-1"> </option></SELECT>
</div>
</Form>
</DIV>

I think I had this happen before and I had to put it in a table that was 100%... but that was cos it was the only thing onthe page.
any ideas? Can I just go home now?
Michael

The Hobo
Oct 19th, 2002, 10:44 AM
I thought <div> default was 100%?

twanvl
Oct 20th, 2002, 04:41 PM
You must also make sure that the <form> and <div> have no margins ("margin: 0 0 0 0")

punkpie_uk
Oct 21st, 2002, 06:31 AM
I think it is. The problem is that the div is contained in the form, and the form is not set to 100%.

<form style="height:100%; width:100%;">

Also, do as twanvl said and turn off the form margins for correct displaying.

msimmons
Oct 21st, 2002, 10:04 AM
cool thanks. My biggest problem was that I was using "color:red;" to see where the div was rather than "background-color:red;" so no matter that I did I couldn't get it :rolleyes: I love when I spend alot of time on something just to find out I am doing something stupid.
:)
Michael