Stefan: Verständisfrage mit margin

Beitrag lesen

Hallo,

Habe 2 Divs:
.div1 {width:auto; height:auto; background-color:red}
.div2 {width:auto; height:10px; margin:10px; background-color:green}

<div class="div1">
  <div class="div2"></div>
</div>

Das Problem ist jetzt, dass der hintergrund vom div1 nicht mehr angezeigt wird, solange kein text oder kein tag vor und nach dem margin kommt.

Könnt ihr mir helfen...Vielen Dank