Is there any way to position an element relative to the position of another element in a page? I've tried using the relative attribute of the position property, but that just seems to position it relative to where the preceding element would be if the page was plain HTML, as opposed to where the CSS-placed element actually *is*.
The relative attribute is used to position an element relative to the container element. I don't think it's possible, using just css, to position an element(1) according to the position of another element(2) position if 1 isn't within 2.
Could you give us some more details as to what you're trying to acheive? There may be a simple way around the problem or it may require some scripting.
It sounds like you are trying to absolutely position element #1, then relatively position element #2 in relation to #1. Is that correct?
If it is, then try creating a DIV that is absolutely position. Put it where you want it, then put #1 and #2 inside that DIV. #1 will position itself to the top left of the DIV, then #2 will be relative to #1 and in the right position.
Shane: Thanks, I just needed to put the elements I wanted to position inside a container element.