I've been trying to position my <h1>
header on top of a light
div with a background image called light.png
. I used Z-index
to stack them and added position:relative
, but for some reason, the <h1>
is not showing above the <div class=light>
.
Can someone help me figure out what I'm doing wrong? Here's the relevant section of my HTML code:
<body>
<div class="light"></div>
<h1>sdfdsf</h1>
</body>
This is my CSS code:
body {
background-image: url(images/bg.jpg);
background-repeat: repeat;
z-index:1;
}
.light {
background-image: url(images/light.png);
margin-left:auto;
margin-right:auto;
z-index:2;
width:763px;
height:566px;
position:relative;
}
h1 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 48px;
color: rgba(255,255,255,1);
position:relative;
z-index:5;
}