margin-top in a nested div

JuanPablo picture JuanPablo · May 23, 2010 · Viewed 40.8k times · Source

I have a problem with the margin-top in a nested div -- when I apply margin-top to the nested div, the margin is applied to the parent div instead of the nested div.

Any ideas?

Answer

JuanPablo picture JuanPablo · May 23, 2010

I get the solution with overflow:auto in the parent div.