![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Okay, I believe this is one of the biggest issues found using CSS/DIV layout. But, I haven't found a non-Javascript solution. I would like two DIVs - first DIV, say with a height of 20px. The second DIV with a height of 100% (the rest of the viewport). |
#3
| |||
| |||
|
|
In article c7b0dac0-dbc9-44cf-9a06-576cfef57... (AT) z11g2000prl (DOT) googlegroups.com>, *msoliver <michaelsoli... (AT) gmail (DOT) com> wrote: Okay, I believe this is one of the biggest issues found using CSS/DIV layout. But, I haven't found a non-Javascript solution. I would like two DIVs - first DIV, say with a height of 20px. The second DIV with a height of 100% (the rest of the viewport). There are different ways to skin this cat (your description is not quite accurate but I sort of know what you mean). This looks ok in FF 3, Safari 3 and iCab 4, Opera 9.5: http://dorayme.890m.com/alt/px_percent_heights.html -- dorayme |
#4
| |||
| |||
|
|
On Sep 23, 6:44*pm, dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote: In article c7b0dac0-dbc9-44cf-9a06-576cfef57... (AT) z11g2000prl (DOT) googlegroups.com>, *msoliver <michaelsoli... (AT) gmail (DOT) com> wrote: Okay, I believe this is one of the biggest issues found using CSS/DIV layout. But, I haven't found a non-Javascript solution. I would like two DIVs - first DIV, say with a height of 20px. The second DIV with a height of 100% (the rest of the viewport). There are different ways to skin this cat (your description is not quite accurate but I sort of know what you mean). This looks ok in FF 3, Safari 3 and iCab 4, Opera 9.5: http://dorayme.890m.com/alt/px_percent_heights.html -- dorayme Thanks, but unfortunately, there is a problem with your solution: DIV top is 20 px high and DIV rest is 100% high. |
|
DIV rest appears to be 100% - 20px, but it's the full height of the viewport. You can see this if you remove the background of the top div. So, what's going on is the top DIV is 20px and then the rest DIV is just layered underneath the top DIV, but takes 100% of the viewport. The padding- top: 20px makes the DIV rest content display in the right place, but when I replace it with real content, it's clear that the height is off... |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
I appreciate all of your help. How about I just show the HTML - hopefully this will explain things better. I cleaned up the HTML a bit for clarify sake. I have a surrounding DIV, GridDiv. Then I have two child divs, HeadingDiv, and DataDiv. GridDiv is already expanded to 100% of the viewport. I want HeadingDiv to be 20px,which is easy enough. And then I want DataDiv to take the rest of the viewport's height (100% - 20px). If I added padding-top to DataDiv, I see the first table row. However, as the Data Table grows, the scroll bar will show up and take up the full viewport's height (which is how I noticed that the second div is still 100% of the viewport, not 100% - 20px... Make more sense? Thanks! body onload="onload()" div id="GridDiv" div id="HeadingDiv" table cellspacing="0" cellpadding="0" tr td class="cell">Col1</td td class="cell">Col2</td td class="cell">Col3</td |
#7
| |||
| |||
|
|
At such, I'll not get a container div with the height of 100% - 20px, which is my goal. |
|
Is this possible? |
#8
| |||
| |||
|
|
I appreciate all of your help. How about I just show the HTML - hopefully this will explain things better. I cleaned up the HTML a bit for clarify sake. I have a surrounding DIV, GridDiv. Then I have two child divs, HeadingDiv, and DataDiv. GridDiv is already expanded to 100% of the viewport. I want HeadingDiv to be 20px,which is easy enough. And then I want DataDiv to take the rest of the viewport's height (100% - 20px). If I added padding-top to DataDiv, I see the first table row. However, as the Data Table grows, the scroll bar will show up and take up the full viewport's height (which is how I noticed that the second div is still 100% of the viewport, not 100% - 20px... Make more sense? |
![]() |
| Thread Tools | |
| Display Modes | |
| |