I am struggling with a CSS issue that is really frustrating me. HTML:
<div id="nav">
<ul>
<li><a href="#">Home</a>
<ul>
<li><a href="#">More</a></li>
<li><a href="#">Hawa</a></li>
</ul>
</li>
<li><a href="#">Resume</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
CSS:
#nav {background: #008080;position:relative;}
#nav ul {list-style:none;display:flex;position:relative;}
#nav ul li {width: 50px;display:inline-table;padding: 10px 20px;position:relative;}
#nav ul li:hover {background:#333;}
#nav ul li:hover > ul {display: block;position:absolute;margin-left:0px;width:100%;}
#nav ul li a{text-decoration:none;font-family:Verdana;color:#fff;}
#nav ul ul {display:none;}
#nav ul ul li {background: #008080;}
My issue is :
- The dropdown in my CSS is not aligning correctly with the li element.
Is there anyone who can assist me?