Consider the given HTML code:
.hormenu {
text-decoration: none;
color: black;
padding: 0px 10px;
}
.hormenuParent {
display: inline;
}
.hormenuParent:hover {
background: #91c1f7;
}
.hormenuParent:hover ul {
display: block;
}
<body style="height:100%;">
<nav style="background-color:#f2f2f2; padding:4px 10px;">
<div class="hormenuParent">
<a href="#" class="hormenu">File</a>
<ul style="display:none;">
<li>Open</li>
<li>Save</li>
</ul>
</div>
<div class="hormenuParent">
<a href="#" class="hormenu">Edit</a>
<ul style="display:none;">
<li>Copy</li>
<li>Undo</li>
</ul>
</div>
<div class="hormenuParent">
<a href="#" class="hormenu">View</a>
<ul style="display:none;">
<li>Zoom In</li>
<li>Zoom Out</li>
</ul>
</div>
<div class="hormenuParent">
<a href="#" class="hormenu">Tools</a>
<ul style="display:none;">
<li>Do X</li>
<li>Do Y</li>
</ul>
</div>
<div class="hormenuParent">
<a href="#" class="hormenu">Help</a>
<ul style="display:none;">
<li>About</li>
</ul>
</div>
</nav>
</body>
The expected behavior was for the ul
elements to be visible like a dropdown menu, but they remain hidden. What could be causing this issue?