The solution is to simply not declare
The default is
width: auto, which for block-level elements (such as
div), will take the “full space” available anyway (different to how
width: 100% does it).
Just in case it’s not already clear from my answer: just don’t set a
width on the child
You might instead be interested in