nice, thank you. But what if i wanted the parent to have a height depending on the child's height? Lets say the child is on height:auto, how can the parent automatically get the same height with the child? And if that an be done, can it be set to go like +10px more than whatever the child is? Sorry if my sentence is too confusing
Try setting both to ":auto", that's what I would do. Then add some padding to the parent div.
The code should look something like this:
<!--If you want the padding to affect more than the bottom of the parent
div, just remove the "-bottom" part of the code.-->
<div id="parent" style="height:auto; padding-bottom:10px;">
<div id="child" style="height:auto;">
<p>The length of this paragraph should determine the height for both