Fixed positioning is supposed to define everything in relation to the viewport, so position:fixed
is always going to do that. Try using position:relative
on the child div instead.
(I realize you might need the fixed positioning for other reasons, but if so - you can't really make the width match it's parent with out JS without inherit
)