As mentioned by @vals in the previous response, the current markup setup does not allow for the desired functionality. To address this, I made some modifications to demonstrate how it could be achieved.
To make the page function as intended, I removed the <div class="background">
that enclosed the black bar and image. Additionally, I adjusted the classes for both elements to maintain the same visual effect as before.
You can view the updated version on this jsfiddle link.
Below is the revised HTML and CSS code:
<div class='top-img background'></div>
<img class="background" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSJGQ7eqRuhZQqbX1roKW8zBGVHW-VlmQq0uTGCZjDGDHCRljPp" />
<div class='top'>
</div>
<div class='page'>
</div>
And here is the corresponding CSS:
.background {
position:fixed;
width:100%;
}
.top-img {
height:100px;
background:black;
z-index:9;
}
img {
width:100%;
z-index:7;
top : 100px;
}
.top {
position:fixed;
width:60%;
height:60px;
top:60px;
background:yellow;
z-index:10;
}
.page {
height:900px;
background:orange;
width:80%;
position:relative;
z-index:8;
top:120px;
}