Streaming live at 10am (PST)

How do I influnce what my object is relative to?


#1

How do I influnce what my object is relative to? No matter what I do, this little fella allway says "body"

Though my div is nested 3 levels deep.

How is this supposed to work?


Question about parent elements
#2

Ok, so I solved it. The parent object must have some other positioning then "auto" enabled.


#3

OK, so, the best rule in CSS:

Objects are positioned regarding their closest positioned parent.

Every word is important smile

And luckily, we have the position:relative to play with. So, if you want B to be relative to A, give A position:relative so it's positioned, and B relative + coordinates or absolute + coordinates. Relative with nothing else doesn't have any effect on object. Be sure that no other object is positioned between what you want to position and the reference parent.

I'm going to start making teeshirts with this rule I think smile


#4

ah we posted at the same time smile


#5

Thanks though, good answer. I might be interested in one of those shirts. smile


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.