Struggling to create a transparent header for my website, I encountered an issue where the ul element is positioned below the div. Any solutions or advice would be greatly appreciated. Here's the code snippet:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Website</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300;0,400;0,500;0,700;0,900;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
</head>
<body>
<div class="header">
<h1>My Website</h1>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="downloads.html">Downloads</a></li>
</ul>
</div>
</body>
</html>
*{
margin: 0;
padding: 0;
}
body{
font-family: Rubik;
}
.header{
width: 100%;
height: 80px;
}
.header h1{
text-align: center;
}
.header ul li{
list-style-type: none;
margin: 0;
padding: 0;
display: inline;
}
Despite researching various Stack Overflow threads and forums for solutions, including adjusting the z-index and applying clear:both;, I have not found a resolution yet.