Hi I am trying to set up a page that has an image as background, and I want a nav bar that sits on top of the image. Something like this page https://www.spinxdigital.com/ .
I have had to set the image to relative so I can have text on it, but now that I have set it to relative, the image covers the header/navbar . Could someone please help me out with how to fix this
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="index.css">
<title>Document</title>
</head>
<body>
<header>
<ul id="navbar">
<li><a href="secton1"></a>Section 1</li>
<li><a href="secton2"></a>Section 2</li>
<li><a href="secton3"></a>Section 3</li>
<li><a href="secton4"></a>Section 4</li>
</ul>
</header>
<section id= "headerBackground">
<div class="gameDetails">GAME NAME,
<br>
A WHATEVER GAME</div>
</section>
</body>
</html>
html{
background-color: black;
}
#navbar
{
display: block;
float: right;
color: aliceblue;
margin: 2em;
background-color: green;
}
#navbar li
{
display: inline;
vertical-align: auto;
}
#headerBackground
{
display: block;
background-image: url('assets/topBackground.png');
background-size: cover;
background-position: center;
height: 500px;
font-size: 1em;
color:aliceblue;
position: relative;
top: 80sepx;
}
.gameDetails
{
position: absolute;
bottom: 10%;
right: 10%;
}