I thought a general rule is that, whenever a div foo
has position: relative
, then if none of the parent and ancestor has any non-static posit
It is work div3 is calculating from body not from div2. Because you not specific "top" position of div than div3 get "top" from div2 and make your top point same as top point of div2. When you add atributte "top: 0px;" to dov3 then you see where is div3 and from which element affected div3 position.