Jump to content

Floating DIV inside of a floating DIV - content squashed?


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.

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.