I have this simple code to place two div #container elements side by side. In each of these there is a child div #child which I would like to position
div #container
div #child
To position the child relative to its parent, just add position:relative to the PARENT'S style - then all children with position:absolute will be absolute relative to the parent.
position:relative
.container { float:left; margin-right: 10px; position:relative; }