Hey there, I've been working on creating something similar to this:
However, I'm facing an issue where adjusting the top margin of "3" also affects "2" in the same way. I nested "3" within "2" to align the bottoms.
html,body {
margin: 0;
padding: 0;
}
.example {
background-color: #222;
padding: 100px;
text-align: center;
color: white;
}
.div2 {
background-color: #e8e8e8;
}
.div3 {
margin: -50px auto 0px auto;
padding: 20px;
background-color: #fff;
text-align: center;
width: 80%;
}
h1,p {
padding: 0px;
margin: 0px;
}
<div class="example">
<h1>
Div 1
</h1>
</div>
<div class="div2">
<div class="div3">
<h1>
Div 3
</h1>
<p>
Text Text Text Text Text Text Text Text Text Text Text
</p>
</div>
</div>
<div class="example">
<h1>
Div 4
</h1>
</div>