Forum Moderators: not2easy
I noticed that if I use percent it moves with the page to the left but as px it moves away from the page to the right. I would like for it to stay in its place and disappear as the browser is resized just as the rest of the page does.
I tried nesting divs but that didn't work for me, maybe because I was guessing at a solution.
an example of what I am talking about is:
[header]
[content]--------[sidebar] ---> moves this way when browser resized <-- this way or ---> that way
.
.
.
.
.
[footer]
So if someone resizes the browser to from the right side moving it to the left my sidebar moves off the page to the right. The same is for if the user moves the browser from left side to right, making the browser smaller.
So my question is what can I do to position this sidebar so that when the browser is resized it will stay in the same place?
thanks
<body>
<div id="mainpage">
<div class="navigation">
</div></div>
</body>
#mainpage{width:950px}
.navigation{width:something;float:right}
Perhaps the main issue is that you did not realize that you MUST specify a width to get the kind of effect you want. It needs to have a basis point to look at from when the browser is resized. Perhaps it's not very obvious, but it's extremely important to realize. Also absolute positioning does have it's uses, but most of the time it's unnecessary and messy and possibly difficult to be using them.
So, my question is this. Will I need to absolutely position the wrapper div to make this work?
I noticed when I wrapped my div in another div and positioned the wrapper in the same place as the original div, it still moved with the page as it was being resized. Oh, perhaps if I set the width of the div to be as wide as the remaining page as it would be going to the left from the right side then that would force it to stay in place! Is that what you mean?
I'll try your solution and post back my results. Thank you very much!
James
This thread is solved for me, so thanks a lot for the help!
Regards,
James