Topic: CSS inline vs block
I'm setting up what I think is a fairly straightforward layout using css but I'm having some problems putting inline elements into a block element.
My goal is to have a container div that has a certain background color (different from the body background), to include some (inline) divs in the container and to have the container adjust its height to the content automatically. Here's what I tried to do:
<div style="width: 800px; background: #def; margin: 0px auto;">
<div style="width: 200px; float: left;">
<div style="width: 600px; float: left;">
But this seems to crop the container to a height of 0px, because it doesn't take the inline (float) elements into account. I can 'fix' it by making the container an inline element as well but that breaks the rest of my layout, i.e. having the container centered.
Any thoughts on how to get around this?
* Multiple child models in a dynamic form