PDA

View Full Version : Nested div issue?


badutahboy
12-03-2008, 08:21 PM
Sorry, I feel like I'm bombing the board with stupid questions.. I appreciate how patient you guys are.

Here's today's issue...

First, a link so you can check out what I'm looking at...

http://badutahboy.07x.net/redboxes1.html

Ok, in my center box (body), I've created two nested divs, in order to put a border under the word sellers...

My problem is this... I want the page to resize vertically according to the content... It's already set to resize horizontally..

However, for some reason, if I set the main body div to "auto" or leave the height field blank.. the div simply disappears, taking it's background with it, even though I have the two divs inside it. I assumed it would make it resize to the height of the two divs inside it...


Can someone clue me into how to fix this problem? I'm trying to avoid having my text run out the bottom of the background, but also want to avoid big empty red areas if someone is on a high res computer which will shrink the length of my text.


Or.. am I being stupid, and should just go back and build my page for a fixed resolution?

domedia
12-03-2008, 08:53 PM
If you position things absolutely, you take it out of the regular flow of the document. No boxes can expand naturally anymore. For a layout you're doing, I don't think this is a good approach.
Doesn't DW come with pre made templates for this? or is this one of them?

BTW: the page looked fine to me.

badutahboy
12-04-2008, 12:25 AM
If you position things absolutely, you take it out of the regular flow of the document. No boxes can expand naturally anymore. For a layout you're doing, I don't think this is a good approach.
Doesn't DW come with pre made templates for this? or is this one of them?

BTW: the page looked fine to me.


I just put up a new page, so you can better see the issue...

http://badutahboy.07x.com/redboxes1-issue.html

I want the central box to resize automatically with the text. Right now, if you look at it in about 800px resolution, the text hangs out the bottom, because the div has a height in pixels... but if you stretch it out, suddenly there's a bunch of extra red at the bottom of the page.

I don't know how to correct this issue, because anytime I start playing with the underlying div, it just messes up the background color...

coloeagle
12-04-2008, 08:56 PM
Do not use a set height for the div. This will allow the div to expand or contract when viewed in different size browsers.

badutahboy
12-05-2008, 06:08 AM
Do not use a set height for the div. This will allow the div to expand or contract when viewed in different size browsers.

I tried that... it makes the master div disappear, taking the background color with it...

domedia
12-05-2008, 01:28 PM
You can't fix it with setting a height.. that only creates new problems.
My guess is that maybe you have floated elements in there? If so you need to clear the floats.