Warum überlappt sich Text auf derselben Ebene - auch wenn er einen undurchsichtigen Hintergrund hat?

Ich weiß, dass ich Elemente in separaten Ebenen stapeln kann, indem ich neue Stapelkontexte mit relativer / absoluter Positionierung erstelle (Demo) oder Opazität (Demo)

Ich hatte jedoch den Eindruck, dass standardmäßig ein Element weiter unten im HTML-Code über den vorherigen Elementen angezeigt wird.

Anscheinend ist dies für den Hintergrund des Elements der Fall, aber ich habe gerade bemerkt, dass Text anders funktioniert.

Also mit einfachem Markup wie:

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

Der Hintergrund der 2. Division wird über dem ersten liegen, der Text überlappt sich jedoch.

.div1,
.div2 {
  width: 200px;
  height: 150px;
  overflow: hidden;
  color: white;
}
.div1 {
  background: maroon;
}
.div2 {
  background: green;
  margin: -100px 0 0 100px;
}
<div class="div1"></div>
<div class="div2"></div>
<hr />
<div class="div1">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
  survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing
  software like Aldus PageMaker including versions of Lorem Ipsum.</div>
<div class="div2">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
  survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing
  software like Aldus PageMaker including versions of Lorem Ipsum.</div>

Demo

Muss ich einen neuen Stapelkontext erstellen, um zu verhindern, dass sich der Text hier überschneidet?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage