[I’m not sure if this question has been asked, though I’ve looked around a bit.]
I have a DIV inside a DIV. I would like the inner DIV to have a certain position inside the outer div. I’m having some success with this
position: absolute; top: 0px;right:0px;
but all other divs are getting moved around. I just want it to float on top of the other stuff (float didn’t work, of course).
Thanks!
Edit: The outer div is relative, and I’d like the inner to move with it when the browser is resized.
Edit: Sorry, I’ve figured out the question (but not the answer): if I use right:0px, the inner div stops moving relative to the outer div and starts moving relative to the browser window. Why would that be?
Use
position: absoluteon the inner element. If your outer element is relatively positioned like you say, you can set the position based on the top-left of the outer element.