<body>
<div id="header"></div>
<div id="mainArea">
<div class="container page">
/* Paragraph here */
</div>
</div>
</body>
I intended to have a drop menu on "header" and have a page designed as this
[.
But after that, when I changed the opacity of "mainArea" to 0.8, it turned out to be this [.
The mainArea
is now on top of the navigation bar in the header
. I tried to changed its z-index but nothing changed.
Update:
I'd already read about the stacking context, you can read it more detail at MDN The stacking context.
The only thing I mistook then is that I thought z-index was inherited, but it turned out to be not. Nevertheless, when I tried to apply it on children positioned element and it worked.
Hope this will help somebody has the same problem. The recommend links of the others are also very useful for me.