Try simply drag red square. Everything is going alright.
Put it at left-upper corner - coords will be 0,0;
And now change square size and drug it. Position is not more relative to #container object. =(
Put it at left-upper corner - coords will not be 0,0;
Position: