I know it has something to do with the header ul li in css, but I'm not sure why it overlaps and how to fix it. I did float left for my navigation bar, but the section goes on top of that. html. The top left should have a navigation bar with a dropdown menu, and I'm trying to put a showcase under that which covers the rest of the screen. However, when i put the showcase in, it only overlaps the header. I'm confused any help will be appreciated :).
<!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="css/style.css">
</head>
<body>
<header>
<div class="container">
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li class="dropdown-link"><a href="#">list 1</a>
<ul>
<li class="dropdown-content"><a href="#">sublist 1</a></li>
<li class="dropdown-content"><a href="#">sublist 2</a></li>
</ul>
</li>
<li class="dropdown-link"><a href="#">list 2</a>
<ul>
<li class="dropdown-content"><a href="#">sublist 1</a></li>
<li class="dropdown-content"><a href="#">sublist 2</a></li>
</ul>
</li>
</ul>
</nav>
</div>
</header>
<section>
<h1> Hello World</h1>
</section>
</body>
</html>enter code here
body {
padding: 0;
margin: 0;
}
/* global */
.container {
width: 100%;
float: none;
}
ul {
padding: 0;
margin: 0;
list-style: none;
}
ul li a {
color: black;
text-decoration: none;
}
/* header */
header {
width: 90%;
margin: auto;
display: block;
}
header ul li {
float: left;
padding: 10px
}
.dropdown-content {
float: none;
padding: 5px 0 5px 0;
display: none;
}
.dropdown-link:hover .dropdown-content {
display: block;
}
/* showcase */
.showcase {
display: block;
}