Here is a solution that should work for you:
Simply update the selection to
ul#topmenu li a#HyperLink:hover+ul
and add
display: list-item !important;
. This adjustment should resolve your issue.
ul#topmenu li a#HyperLink:hover+ul {
background-color: pink;
display: list-item !important;
}
<ul id="topmenu">
<li class="langHorzMenu">
<a href="#" id="HyperLink">French</a>
<ul id="Submenu" style="display:none;">
<li>
<a href="#">News</a>
</li>
</ul>
</li>
</ul>
If you want to apply the :hover
effect to the "News" link as well, you can also use the following approach:
Add the following code snippet:
#Submenu:hover {
background-color: pink;
display: list-item !important;
}
This will ensure that once the "News" link is displayed, hovering over it will not cause it to disappear.
ul#topmenu li a#HyperLink:hover+ul {
background-color: pink;
display: list-item !important;
}
#Submenu:hover {
background-color: pink;
display: list-item !important;
}
<ul id="topmenu">
<li class="langHorzMenu">
<a href="#" id="HyperLink">French</a>
<ul id="Submenu" style="display:none;">
<li>
<a href="#">News</a>
</li>
</ul>
</li>
</ul>