The idea
position: absolute removes an element from the normal flow, so the space it occupied collapses and its siblings move up to fill the gap. Make box A leave the flow — B rises to the top, and A floats over to the top-right corner.
margin is off-limits — the point is that position: absolute pulls A out of flow so B rises to fill the gap.