My content and my background are divs with absolute positioning - how do I stretch the background div to match the height of the content?

Set background as position: fixed that way, it will stick with the scroll.

Set #background as position: fixed that way, it will stick with the scroll. However, isn't it a better solution to do something like this? : #content { position:absolute; left:0px; top:0px; width:100%; height:100%; background: } OP stated it's not possible.

Another thing you could do, is to nest them, like so: That way, you only absolute position #background and the content inside of #content will automatically stretch it by default, because it is normal behavior for nested divs.

Thanks, but no, since my background is a complex background with several layers and some dynamic scripted voodoo. Also I guess setting it to fixed would work, but that's not exactly what I'm looking for. If all else fails, I guess I'll fall back to that... – Orteil Aug 29 at 16:09 In which case, you could nest them.

I'll update the answer. – Truth Aug 29 at 16:11 As stated in my question, I have tried putting the content div inside the background div, but this doesn't work; I believe that's due to the content div having a position:absolute (which is necessary for other things) - furthermore, it messes with the other elements in the background pretty badly. Thanks anyway.

– Orteil Aug 29 at 16:21 You need to expand your question so that we can take all those parameters into account, we suggest a solution, "no but it messes up a different area in my code", then show it to us, it's very possible you're doing the whole thing wrong and there's a better solution. – Truth Aug 29 at 16:24 Done; I added the structure I'm using. I'm sorry, I didn't mean to sound demanding or whiny.

I appreciate the help. – Orteil Aug 29 at 16:47.

You could use a little JS action to get this done.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions