I am trying to make a drop down menu and have been following this video but trying to implement this on his other video below on how to create a loginsystem. Something seems to be preventing my drop down menus to be displayed. Whenever I go further than 2 sub menus, the menus will disappear quickly… I am new here so not sure how the format system works… Do I need to format my code but doing the backticks?
Here is my html code:
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="#">Primer Level</a>
<ul>
<li><a href="#">Level 1</a></li>
<li><a href="#">Level 2</a></li>
<li><a href="#">Level 3</a></li>
</ul>
</li>
<li><a href="signup.php">Signup</a></li>
<li><a href="update.php">Update Profile</a></li>
<li><a href="reset.php">Reset Password</a></li>
<li><a href="qa.php">Q/A</a>
<ul>
<li><a href="contact.php">Contact Us</a></li>
<li><a href="donation.php">Donation</a></li>
<li><a href="maintenance.php">Status</a></li>
<li><a href="review.php">Review</a></li>
<li><a href="activate.php">Activate Email</a></li>
<li><a href="bulletin.php">Bulletin</a></li>
</ul>
</li>
Here is my CSS:
body {
background-color: #ccc;
}
header nav {
width: 100%;
height: 150px;
background-color: #fff;
}
header nav ul {
float: left;
}
header nav ul li {
float: left;
list-style:none;
position: relative;
padding-top: 50px
}
header nav ul li a{
font-family: arial;
font-size: 14px;
color: #111;
font-weight: bold;
display: block;
text-decoration: none;
}
header nav ul li ul{
display: none;
position: absolute;
background-color: #fff;
padding: 10px;
border-radius: 0px 0px 4px 4px;
}
header nav ul li:hover ul{
display: block;
}
header nav ul li ul li {
width: 180px;
border-radius: 4px;
}
header nav ul li ul li a {
padding: 8px 14px;
}
header nav ul li ul li a:hover {
background-color: #f3f3f3;
}
At the moment, it the sub menus is not showing below this point:
I was planning to take a picture of it but it is hard to do when I only have one mouse…