我创建了一个包含子菜单的 HTML 菜单,但是当我将鼠标悬停在主菜单上并显示子菜单时,我无法访问它。在我向下移动鼠标导航到它之前,它就消失了。我不知道我做错了什么,也许有人可以用我的代码来帮忙。谢谢
#header ul { position: absolute; top: 88px; left: 0; }
#header ul li { display: inline;}
#header ul li a { font-size: 11px; text-decoration: none; text-transform: uppercase; margin-right: 20px; color: #fff; line-height: 2em;}
#header ul li ul{ position: static;display: none; z-index: 999;top:150%;}
#header ul li:hover a { font-weight:bold; color: #000000}
#header ul li:hover ul { display: block; position:absolute;}
编辑以显示 HTML
<ul>
<li><a href="/Default.aspx">Home</a>
</li>
<li>
<a href="/Cover/HRMS.aspx">HRMS</a>
<ul>
<li>
<a href="/Cover/HRMS.aspx">Position</a>
</li>
<li>
<a href="/Cover/HRMS.aspx">COA</a>
</li>
<li>
<a href="/Cover/HRMS.aspx">Employee</a>
</li>
<li>
<a href="/Cover/HRMS.aspx">Estate</a>
</li>
</ul>
</li>
<li>
<a href="/Cover/EmployeeMaintenance.aspx">Employee Maintenance</a>
</li>
<li>
<a href="/Cover/Payroll.aspx">Payroll</a>
</li>
<li>
<a href="/Cover/DataTransfer.aspx">Data Transfer</a>
</li>
<li>
<a href="/Cover/Reports.aspx">Reports</a>
</li>
<li>
<a href="/Cover/Administration.aspx">Administration</a>
</li>
<li>
<a href="/Cover/Help.aspx">Help</a>
</li>
</ul>