Is there a way to position the div above the image rather than below it, even when setting the z-index attribute in the code?
The current code structure is as follows:
<main id="content" role="main">
<div style="text-align: center">
<img src="assets/header-img.jpg" style="z-index: -1;">
</div>
<div class="container" style="background-color: bisque; height: 1000px; margin-top: -680px"></div>
</main>
There are two questions at hand:
- In order to move up the container-div, the code uses "margin-top:-680px", which corresponds to the image height. Are there any alternative solutions for achieving this effect?
- How can the container-div be positioned above the image instead of below it?