...

View Full Version : position: absolute; not working as I expect (IE6)



Roy Gardiner
03-14-2005, 05:48 PM
It looks to me as if specifying position: absolute; positions the element relative to the start of the document, not to the start of the containing block as my book says.

What am I missing here?

liorean
03-14-2005, 06:49 PM
You're missing the definition of "Containing Block". Containing block is not the same as parent. The containing block is the closest positioned ancestor. (I.e. the closest ancestor that has it's position property set to a value other than static.)

The fix for your problem is to add position: relative; to the element you want the absolutely positioned element to be relative to.

Roy Gardiner
03-14-2005, 07:40 PM
You're missing the definition of "Containing Block". Containing block is not the same as parent. The containing block is the closest positioned ancestor. (I.e. the closest ancestor that has it's position property set to a value other than static.)

The fix for your problem is to add position: relative; to the element you want the absolutely positioned element to be relative to. Hah, my understanding is way more broken than I thought :mad: but thank you, this should fix me up.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum