I was trying to follow the instruction on w3schools to create a dropdown menu.
In the example they use <div>
to create a dropdown container and a div for the dropdown content which contains <a>
.
Now I’ve read on google that when I place the code between an <ul>
it is invalid.
Should I use <span>
or just <li>
?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<nav>
<ul>
<div class="dropdownContainer">
<li class="dropdownButton"><a href="#">Asiel</a></li>
<div class="dropdownContent">
<a href="#">Tarieven</a>
<a href="#">Onze katten</a>
<a href="#">Onze honden</a>
<a href="#">Afstandsbeleid</a>
<a href="#">Gevonden of vermist</a>
<a href="#">Plaatsingsvoorwaarden</a>
</div>
</div>
</ul>
</nav>
<div class="innernav"></div>
</div>
<script src="script.js"></script>
</body>
</html>