Help me with the concept of margin here. I assume the margin-top: 40px in the CSS applies to both divs. So I can see this for the Red div - there’s a 40px space between it and the upper border of the window of the browser. Should the Blue div not be at the same height as the Red div since the same margin rule applies to it as well?
<style>
div {
width: 60%;
height: 200px;
margin-top: 40px;
}
.first {
background-color: red;
position: absolute;
z-index: 2
}
.second {
background-color: blue;
position: absolute;
left: 40px;
top: 50px;
z-index: 1;
}
</style>
<div class="first"></div>
<div class="second"></div>