I've encountered an issue where my child's ul li elements are not behaving as expected, despite following advice from other sources. After days of debugging with no success, I am unable to pinpoint the problem. The image showcases the issue perfectly:
https://i.sstatic.net/vOrjD.jpg
<nav id="main-nav" class="main-nav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Dropdown ↓ </a>
<ul id="sublist">
<li><a href="#">Tomorrow</a></li>
<li><a href="#">Doomoro</a></li>
</ul>
</li>
<li><a href="#">Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</nav>
css:
nav ul li a {
font-family:'Cookie', cursive;
background-color:#400000 ;
border-radius: 0.5em;
color:#fff;
display:block;
line-height:3em;
text-align:center;
text-decoration:none;
width:100%;
}
nav ul li a:hover {
background-color:#680000 ;
color:white;
}
nav ul li ul {
display: none;
position: absolute;
top: 48px;
}
nav ul li:hover ul {
display: block;
position: absolute;
opacity: 1;
}
nav ul li:hover li {
float: none;
}
#sublist li a {
font-family:'Cookie', cursive;
background-color:#400000 ;
border-radius: 0.3em;
color:#fff;
display:block;
line-height:3em;
text-align:center;
text-decoration:none;
width:100%;
}
Clarifications: The 'a' element is the smaller one. Thank you for any assistance provided.