Jump to content

Floating DIV inside of a floating DIV - content squashed?


GuitarGod

Recommended Posts

Hi all,

 

I'm creating a page with some floating DIV menus - using the position:fixed style attribute. Example:

 

<div id="div1" style="position:fixed">some content
<div id="div2" style="position:fixed">big content</div>
</div>

 

My problem is that the content in div2 is limited to the size of div1, but I thought putting the position:fixed attribute means that the content of div2 could be as big as it wanted as the div is "free" - if that makes sense? Is there any way around this?

 

Thanks for any and all help! :D

It makes perfect sense that the inner div couldn't be any bigger than the container div. That's the exact reason why you would put div2 inside of div1. If you want both to be "free", don't nest them inside of each other.

 

<div id="div1" style="position:fixed">some content</div>
<div id="div2" style="position:fixed">big content</div>

 

 

It's a shot in the dark, but I believe you might be able to make the inside div bigger than the container div, if you don't have overflow:hidden set in your css. I could be wrong though.

  Quote

It makes perfect sense that the inner div couldn't be any bigger than the container div. That's the exact reason why you would put div2 inside of div1. If you want both to be "free", don't nest them inside of each other.

 

Excellent advice, I didn't even think of doing it that way - problem solved. Cheers! :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.