I am encountering an issue where the drop-down menu is visible, but when I try to make it disappear and then hover over it again to bring it back, it does not reappear. Here is the CSS code I am using:
* {
margin: 0;
padding: 0;
}
body {
background-color: black;
background-size: cover;
}
nav {
width: 100%;
height: 60px;
background-color: #fff;
}
nav p {
font-family: arial;
color: #222;
font-size: 22px;
line-height: 55px;
float: left;
padding: 0px 20px;
}
nav ul {
float: left;
}
nav ul li {
float: left;
list-style: none;
position: relative;
}
nav ul li a {
display: block;
font-family: arial;
color: #222;
font-size: 14px;
padding: 22px 14px;
text-decoration: none;
}
nav ul li ul {
display: none;
position: absolute;
background-color: #fff;
padding: 10px;
border-radius: 0px 0px 4px 4px;
}
nav ul li:hover ul {
display: block;
}
nav ul li ul li {
width: 180px;
border-radius: 4px;
}
nav ul li ul li a {
padding: 8px 14px;
}
nav ul li ul li a:hover {
background-color: #f3f3f3;
}
After adding 'display: none', the menu disappears and doesn't return as expected. Can someone please assist me with this issue? I am following instructions from a Youtube video: https://www.youtube.com/watch?v=rgUp302f_lY&t=837s