div background color to fill to container boundary
I have a problem I thought someone might be able to help me with. I've read various articles about using 'height:auto' in the container and/or 'display:block' but none seem to work. So I thought I'd ask here directly.
I have a page where I'm creating pseudo table structure using divs. I.e.
<div id="edit" style="background-color:#99FF99; layer-background-color:#99FF99;" >
<div id="cfgName" style="background-color:#99FF99; layer-background-color:#99FF99;">some stuff</div>
<div id="cfgType" style="background-color:#99FF99; layer-background-color:#99FF99;">more stuff</div>
<div id="cfgValue" style="background-color:#99FF99; layer-background-color:#99FF99;"> more stuff</div>
<div id="cfgComment" style="background-color:#99FF99; layer-background-color:#99FF99;"> maybe multiple lines of stuff that expand wider than the div</div>
</div>
First off I know I should be somehow using the color in CSS but it's variable dependent on another value and I don't know how to do this conditionally in CSS2. But that's not the main problem.
The main problem is that if/when the comment div goes to more than one line, the other divs end up with white space below. I need to know how to get these divs to fill to the bottom of the parent 'edit' container (or make them transparent so that they pass through the color of the container). I've tried using 'height:100%' and it doesn't seem to have any effect. I'm using Firefox and will do the necessary IE hacking after I get it working in Firefox.
Any suggestions? I'm sure it's something simple but I don't know what it is.
If you are using CSS to create a table appearance (table with one row, 4 columns, please post the css used for that effect. I could be misunderstanding your question, but you could add text to any of the div's you gave and the bg color stay the same.
Chris
Last edited by chrisrock79; 09-27-2005 at 11:24 PM.
I thought I'd posted the relevant CSS. But here's the divs and the container that are used. (note: this is an excerpt of a page that has maybe 50 rows.
<input style="background-color:#99FF99;" type="radio" name="pValue[Debug]" value="1"/>True
</label>
<label>
<input style="background-color:#99FF99;" type="radio" name="pValue[Debug]" value="0" CHECKED
/>False</label>
</div> <!-- cfgValue -->
<div class="cfgComment" style="background-color:#99FF99; layer-background-color:#99FF99">
<input style="background-color:#99FF99;" style="width:100%;" type="text" name="pComment[Debug]" value="Debugging on or off. This is a long comment so it should cause the non-fill behavior I'm having trouble with." />
I'm not sure this is addressing the same problem. I essentially have 7 floated divs that make up a "row" of information within 2 container divs (one for the page section and one for the row). It's probably easiest to show you the example by giving you the link to the page and letting you see what I end up with. The link is: http://pdx1.1sit.com/evtmgr/admin/ed...php?cfgEntID=1
Notice that the line for the parameter "cfgCompanyName" (2nd confuration area of the page - the ones with gray background) has a longer comment and the other divs do not stretch down to fill the space. Hence there's a blocky chunk of white space on the type of rows.
Since I don't know how much text will be associated with a comment I can't arbitrarily come up with a "row height" that would be relevant. Maybe using a table in this case would be better suited but I wanted to get the div stuff working. It's much easier to manage once it's designed and implemented.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
The basic problem is that floating an element takes it out of the normal flow, so the containing block does not reserve space for it.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks